On this page
What this issue is
A GTM trigger is the rule that says when a tag should fire. Many click and form triggers use a CSS class (a label in the page's HTML used for styling), for example Click Classes contains `btn-primary` or a Click - Just Links trigger with the condition Click Element matches CSS selector `.hero-cta`.
- Visitor clicks buttonButton now has class button--solid
- GTM trigger checks classLooks for btn-primary, finds none
- Tag firesNever runs
- Conversion in GA4 / adsNever recorded
The visitor journey is fine. Only the tracking step fails, so every later report step is empty.
Why it costs you leads or sales
Example: real leads stay steady, but recorded conversions fall to near zero in the week the class is renamed.
How to check if your site has it
Open Preview modeGoogle Tag Manager
In GTM click Preview, enter your page URL and connect Tag Assistant.
Do the action
Click the button or link the trigger is meant to track on the live, redesigned page.
Check the event summaryGoogle Tag Manager
In Tag Assistant select the click event on the left. Under Tags, see whether your tag is listed as Fired or Not Fired.
Compare the classGoogle Tag Manager
Select the Variables tab for that click and read Click Classes, Click ID and Click Element. Compare them with the value in your trigger condition.
Inspect the element
Right-click the button in your browser, choose Inspect and read its real class and attributes.
How to fix it
<a href="/book" class="button--solid" data-track="hero-cta">Book a call</a>Edit the trigger
Open Triggers, select the trigger, and change the condition to Click Element matches CSS selector with your new selector.
Test and publish
Run Preview, confirm the tag fires on the click, then Submit and Publish the workspace.
Add the attribute
In the block editor select the button, open Advanced and add a CSS class or use the block's HTML view. Page builders such as Elementor and Divi have custom attribute fields in the element's Advanced settings.
Check the theme
If the button is in a theme template, add the data-track attribute there, ideally in a child theme so updates do not remove it.
Add a custom attribute
Select the element, open Element Settings (the gear icon) and under Custom attributes add name data-track and value hero-cta.
Publish the site
Publish so the attribute reaches the live page, then retest in GTM Preview.
Edit the theme code
In Online Store, Themes, Edit code, find the button in the section or snippet file and add data-track="add-to-cart" to it. Duplicate the theme first as a backup.
Re-test after theme updates
Theme updates can overwrite edits, so check the attribute is still there after each update.
Add the attribute in the template
Add data-track to the element in your template or component and make it part of your code review so it is not removed during refactors.
| Trigger hook | Stability | Comment |
|---|---|---|
| Styling class (btn-primary) | Low | Changes with themes and design systems |
| Hashed class (css-1x9fk2) | Very low | Can change on every build |
| Click Text | Low | Breaks on copy edits |
| Element ID | Medium | Stable if developers keep it |
| data-track attribute | High | Exists only for tracking |
How to confirm it's fixed
- In GTM Preview the tag shows as Fired on the click.
- The trigger condition shows as met in the Tag Assistant variables view.
- The hit appears in your browser's Network tab or in GA4 DebugView.
- The conversion shows up in GA4 Realtime or the Google Ads and Meta test tools.
- You have published the GTM workspace, not only tested it in Preview.
- You tested on the live domain, on desktop and mobile layouts.
How to prevent it happening again
- Use data attributes or IDs in triggers, never styling classes.
- Keep a short list of tracked elements and their selectors.
- Ask designers and developers to keep data-track attributes when rebuilding templates.
- Run GTM Preview on staging before every redesign launches.
- Check conversion counts the day after any theme or layout release.
- Use automated monitoring that runs the real journey on a schedule.
How FunnelGuard handles this
See the cause and effect
Class renamed
Leads or data lost
The trigger finds no match, the tag never fires and no conversion is recorded.
Toggle to see how the same redesign affects tracking depending on the trigger hook.
Questions people ask
Why did my GTM trigger stop working after a redesign?
The most common reason is that the trigger matches a CSS class, ID or element structure that the redesign changed. The button works but no longer matches the trigger condition, so the tag does not fire. Compare Click Classes in GTM Preview with the new button's real class.
How do I fix a Google Tag Manager click trigger that is not firing?
Open GTM Preview, click the element and read the Click Classes, Click ID and Click Element variables. Update the trigger condition to match the new value, or better, add a data attribute and use a CSS selector like [data-track="cta"]. Test in Preview and publish.
What is a better trigger than a CSS class in GTM?
A data attribute added only for tracking, such as data-track, is the most stable choice. An element ID is the next best option. Styling classes and button text are the most likely to change during design or copy edits.
How do I find the new CSS class of a button?
Right-click the button in your browser, choose Inspect and read the class attribute in the highlighted HTML. You can also see it in GTM Preview under Variables as Click Classes after you click the element.
How can I tell if a redesign broke my conversion tracking?
Compare conversion counts before and after the launch with the real number of leads or orders. If recorded conversions fall while real ones do not, test your triggers in GTM Preview. Scheduled monitoring that runs the journey can also flag a missing tracking hit.
Does GTM warn me when a trigger no longer matches anything?
No. GTM does not show an error when a trigger condition stops matching. The tag simply never fires, which is why the problem can go unnoticed for weeks.
Can FunnelGuard detect a trigger broken by a class change?
Yes. FunnelGuard runs your real journey on a schedule and checks that the tracking hit is sent. When the hit is missing it alerts you with a screenshot and a likely cause, using a hash of the page structure to point to changed markup.
Related issues
- TRK-109Trigger depends on Click Text changed by copy editFix guide
- TRK-110Trigger condition uses Page URL that no longer matchesFix guide
- TRK-107Form submission trigger not firing for AJAX formsFix guide
- TRK-111Tag paused in GTMFix guide
- TRK-103Workspace changes never published (tag in preview only)Fix guide
- TRK-106Trigger set to All Pages instead of thank-you pageFix guide