Digital Dan
← All posts

How to track menu clicks with Google Tag Manager and GA4 (2026)

Track menu clicks with Google Tag Manager and Google Analytics 4

To track menu clicks with Google Tag Manager and GA4, create one Click - Just Links trigger that fires when the Click Element matches your menu’s CSS selector (for example #primary-menu a), and one Google Analytics: GA4 Event tag that sends an event such as menu_click with the link text and URL as parameters. You don’t need a separate trigger and tag for every menu item: one pair covers the whole menu, and GA4 tells you which item was clicked.

Want your GA4 events and conversions set up properly the first time? I set up and audit tracking in Tag Manager, GA4 and Google Ads. See my conversion tracking service.

Why track menu clicks at all

Your menu is the map of your website. Menu click data answers questions page views can’t:

  • Which items people actually use, and which nobody touches.
  • Whether visitors look for pricing, contact or a service you buried in a dropdown.
  • Which pages send people back to the menu (often a sign the page didn’t answer their question).
  • Whether a menu change (renamed item, new order) changed behaviour.

GA4’s enhanced measurement already records a click event, but only for outbound links (links to other domains) and file downloads. Clicks on your own menu, which go to your own pages, are not tracked unless you set them up.

Here’s how the whole setup fits together:

A menu click is caught by a Click - Just Links trigger matching the menu's CSS selector, which fires a GA4 Event tag sending menu_click with link_text, link_url and menu_name; GA4 receives the event, menu_name is registered as a custom dimension, and an exploration reports menu clicks by link text and page

Before you start

You need:

Step 1: Turn on the built-in click variables

Tag Manager has built-in variables for clicks, but they’re switched off in a new container:

  1. In Tag Manager, go to Variables.
  2. Under Built-In Variables, click Configure.
  3. Under Clicks, tick Click Element, Click Classes, Click ID, Click Target, Click URL and Click Text.
VariableWhat it holds
Click ElementThe clicked element itself (used for CSS selector matching)
Click ClassesThe clicked element’s class attribute
Click IDThe clicked element’s id attribute
Click TargetThe link’s target attribute (for example _blank)
Click URLThe link’s address
Click TextThe visible text of the link

Step 2: Find your menu’s CSS selector

You need a CSS selector that matches every link in your menu and nothing else.

  1. Open your website in Chrome, right-click a menu item and choose Inspect.
  2. In the Elements panel, look at the containers around the menu’s links. Most themes wrap the menu in a <nav>, <ul> or <div> with an id or a class, such as id="primary-menu" or class="main-nav".
  3. Your selector is that container followed by a space and a (the HTML tag for a link): #primary-menu a for an ID, .main-nav a for a class.

Chrome DevTools showing the menu's HTML, with each menu item carrying its own page-item class inside the primary-menu container

To check the selector before you use it, open the Console tab and run document.querySelectorAll('#primary-menu a').length (with your selector). The number should equal the number of links in your menu, dropdown items included.

Check your mobile menu too. Many themes print a second copy of the menu for phones, with a different ID. If so, list both: #primary-menu a, #mobile-menu a.

Step 3: Create the trigger

  1. Go to Triggers → New and name it, for example Click - Main menu links.
  2. Click Trigger Configuration and, under Click, choose Just Links.

Choose trigger type panel in Google Tag Manager with Just Links highlighted under Click

  1. Leave Wait for Tags and Check Validation unticked unless you have a reason (Wait for Tags delays the link up to the time you set so a tag can finish; it’s rarely needed for a GA4 event).
  2. Under This trigger fires on, choose Some Link Clicks.
  3. In the first dropdown, choose Choose Built-In Variable and then Click Element.

Condition dropdown in the trigger with Choose Built-In Variable selected

Choose Built-In Variable list with Click Element highlighted

  1. In the second dropdown, choose matches CSS selector, and in the third field enter your selector, for example #primary-menu a.
  2. Save.

If you only want one menu item

To track a single link (say, a “Get a quote” button in the menu), use a selector that matches only that item. In this example, the Home item had its own class, page-item-2, so the selector is .page-item-2 a:

Trigger configuration with Click - Just Links, Some Link Clicks, and Click Element matches CSS selector .page-item-2 a

For a full menu, though, one trigger for all links is better. Twenty tags for twenty menu items is how containers become unmanageable, and each new menu item would need a new tag.

Step 4: Create the GA4 event tag

  1. Go to Tags → New and name it, for example GA4 - Event - menu_click.
  2. Click Tag Configuration and choose Google Analytics: GA4 Event.
  3. In Measurement ID, enter your G- ID (or a Constant variable holding it, so you type it once for all your event tags).
  4. In Event Name, enter menu_click.
  5. Under Event Parameters, add three rows:
Event parameterValue
link_text{{Click Text}}
link_url{{Click URL}}
menu_namemain (type it; use footer for a footer menu trigger)
  1. Under Triggering, choose Click - Main menu links.
  2. Save.

If you already send the same parameters with many events, put them in a Google Tag: Event Settings variable and select it in the tag’s Event Settings field instead of repeating them in every tag.

Naming the event and parameters

GA4 is strict about names, and a bad name is permanent in your historical data:

  • Names are case sensitive: menu_click and Menu_Click are two different events.
  • They must start with a letter and use only letters, numbers and underscores. No spaces. The old version of this tutorial named events “Click Top Menu Home”; don’t do that.
  • Event names and parameter names can be up to 40 characters, parameter values up to 100 characters, and an event can carry up to 25 parameters.
  • Don’t call your event click: that’s the name enhanced measurement uses for outbound links, and your menu clicks would mix with them.
  • Don’t use reserved prefixes such as ga_, google_ or firebase_ for parameters.

I use link_text and link_url on purpose: they are the same names enhanced measurement uses, so GA4’s predefined Link text and Link URL dimensions can report them without registering anything. menu_name is my own parameter, so it needs a custom dimension (Step 6).

The GA4 Event tag reads Consent Mode by itself: if a visitor declined analytics cookies, the event follows their choice like every other GA4 hit. If you have visitors from the EEA, the UK or Switzerland, make sure your setup sends the signals; see how to set up Consent Mode v2 with Google Tag Manager.

Step 5: Test with Tag Assistant and DebugView

  1. In Tag Manager, click Preview. Tag Assistant opens; enter your website’s address and click Connect.

Connect Tag Assistant to your site, with the website URL entered and the Connect button

  1. On your website, click a few menu items, including one inside a dropdown and, on a narrow window, one in the mobile menu.
  2. In Tag Assistant, each click appears as a Link Click event on the left. Select it: GA4 - Event - menu_click should be under Tags Fired. If it’s under Tags Not Fired, open it to see which condition failed.
  3. Open the Variables tab for that Link Click and check that Click Text and Click URL hold the right values.
  4. In GA4, go to Admin → Data display → DebugView. Your device appears while preview mode is on; click menu_click in the timeline and check its parameters.

Tip: put the Tag Assistant window and your website side by side. You’ll see each tag fire as you click.

Step 6: Register the parameters in GA4

GA4 collects every parameter you send, but only shows custom ones in reports after you register them:

  1. Go to Admin → Data display → Custom definitions.
  2. On Custom dimensions, click Create custom dimension.
  3. Dimension name: Menu name. Scope: Event. Event parameter: menu_name. Save.
  4. If you named your parameters differently from link_text and link_url, register those too (for example Menu item from menu_item).

Custom dimensions are not retroactive: they show data from the moment you create them, and it can take 24–48 hours to appear. Standard properties can have 50 event-scoped custom dimensions, so don’t register a parameter you’ll never report on.

Step 7: Publish

Back in Tag Manager, click Submit, give the version a clear name and description (for example “Menu click tracking: trigger + GA4 event”), and click Publish.

Google Tag Manager workspace with the Submit button highlighted

Where to see menu clicks in GA4

  • Realtime. Within a minute or so, menu_click appears in the realtime event count. Good for a quick check after publishing.
  • Events report. Reports → Engagement → Events, then click menu_click to see its total and its parameters. Standard reports can take up to 24 hours to fill in.
  • Explorations (the best view). Go to Explore → Free form. Add the dimensions Event name, Link text and Page path and screen class, and the metric Event count. Filter Event name exactly matches menu_click, put Link text in rows, and you have a ranked list of your menu items. Add Page path and screen class as a second row dimension to see where visitors were when they used the menu.

The GA4 metrics worth watching post explains which other numbers to read alongside it.

Should a menu click be a key event?

Usually not. A key event (what GA4 called a conversion until 2024) should be an outcome for the business: a lead, a call, a sale. A menu click is a step on the way. Marking it as a key event inflates your key event count and, if it’s imported into Google Ads as a primary conversion, teaches Smart Bidding to buy menu clicks.

If one menu link really matters (a “Book now” button that opens a booking tool on another site), create a separate event for it and mark that event with the star in Admin → Data display → Events. Standard properties can have up to 30 key events.

Common mistakes I see

  1. One tag per menu item. It works, but it bloats the container and breaks the day someone adds an item. One trigger plus {{Click Text}} covers the whole menu.
  2. The mobile menu is forgotten. The desktop menu is tracked and the phone menu, a separate copy in the HTML, isn’t. Half your traffic disappears from the report.
  3. Spaces and capitals in event names. “Click Top Menu Home” creates one event per item with names GA4 can’t group. Use one snake_case event and put the item in a parameter.
  4. Parameters sent but never registered. The data is collected, but nobody can report on menu_name until it’s a custom dimension, and the days before registration are lost for reporting.
  5. Click Text is empty or messy. Icon-only links have no text, and some themes add hidden text (like “submenu toggle”). Send {{Click URL}} too, so you can always tell which item it was.
  6. The selector matches too much. nav a may also catch the footer, breadcrumbs or a logo link. Test the selector in the Console before trusting it.
  7. Wait for Tags left on with a long timeout. It delays every menu click for no real benefit to a GA4 event.

FAQ

Can I track menu clicks in GA4 without Google Tag Manager?

Yes, with code: a JavaScript listener on your menu links that calls gtag('event', 'menu_click', {...}). It needs a developer for every change, which is why I use Tag Manager. Enhanced measurement doesn’t help here, because it only tracks clicks to other domains.

Your CSS selector is too broad, or the theme reuses classes. Check how many elements it matches with document.querySelectorAll('your selector').length in the browser console and make it more specific, usually by starting from the menu container’s ID.

Why don’t I see my menu_click parameters in GA4 reports?

Custom parameters must be registered as custom dimensions in Admin → Data display → Custom definitions. Registration isn’t retroactive, and new data can take 24–48 hours to appear.

Rarely. In the setups I test, GA4 records menu clicks fine without it, and leaving it off means the visitor’s click is never delayed. Turn it on only if testing shows events going missing on links that leave the page immediately.

Yes. Create a second trigger with the footer’s selector and either a second tag with menu_name set to footer, or reuse the same tag and add the footer trigger. For buttons that aren’t links, use the All Elements click trigger instead of Just Links. The full list of options is in every trigger type in Google Tag Manager.

Need help with GA4 and Tag Manager?

I set up click tracking, form tracking and conversions in Tag Manager and GA4, and I make sure the events are named, registered and reported so someone can actually use them. If your GA4 is full of events nobody understands, get in touch about a Tag Manager and GA4 setup and I’ll clean it up.

Daniel Timponi

Digital Marketing Analyst & Consultant · 17+ years crafting digital marketing that converts.

Schedule a call