Sign inBlogSupportContact
Analytics

Create GA4-ready dataLayer events without code

Define what to track, target it by class or ID, and the dataLayer push happens automatically.

3 min read May 2026 create gtm event

Tracking button clicks shouldn't require a developer

You want to track when someone clicks "Add to Cart," submits a contact form, or clicks a CTA button. Google Tag Manager can do it, but creating the trigger requires opening GTM, navigating the interface, defining a trigger, creating a tag, setting variables, and publishing the container.

For "track clicks on this button," that's a lot of steps in a separate tool.

What most people do instead

Google Tag Manager UIOpen GTM, create trigger, create tag, define variables, test in preview mode, publish. 10 minutes per event.
Hardcode dataLayer.push() in themeAdd inline JavaScript to theme templates. Breaks on theme updates. Requires a developer.
Skip tracking entirelyRun ads without conversion tracking. Spend money without knowing what's working.

A better way: define the event from the navigator

Open the navigator. Name the event, specify the target element by CSS class or ID, and the command generates a dataLayer push that fires on click. The tracking script is injected on the frontend automatically.

TrueCommander
GTM event "cta_click" created
GTM EventActive
Event Namecta_click
Targetbutton
CSS Classhero-cta

Works with any GA4 + GTM setup. The command pushes to window.dataLayer. If you have GTM installed (via the tracking pixels command or manually), your GA4 tag picks up the events automatically.

How it works

1
Define the eventName the event and specify the target element. Use -class, -id, or -form_id to target precisely.
2
Script injects on the frontendA lightweight JS file listens for clicks on the targeted elements and pushes to dataLayer.
3
GA4 picks it upIf GTM is configured to forward dataLayer events to GA4, your custom event appears in GA4 reports.
DetailValue
Command namecreate gtm event
Event name-name=cta_click (required)
Target element-target=button (required, CSS selector)
By CSS class-class=hero-cta
By element ID-id=signup-btn
By form ID-form_id=contact-form
Value selector-value_selector=.price (captures text content)
Can be used in

Real example

You're running Google Ads to a landing page with a "Get Started" CTA button. The button has the CSS class hero-cta. You need to track clicks as conversions in GA4 so you can measure which ad copy drives the most signups.

You open the navigator and create a GTM event targeting that button class. The dataLayer push fires on every click. In GA4, you mark "cta_click" as a conversion event. Now every ad click that leads to a CTA click is tracked end-to-end.

Next week, you want to track form submissions too. Another event, targeting the form by ID. Two commands, two conversion events, zero code written.

Goes further with TrueCommander

Ready?

Track conversions without code.

This is one of 91 commands. All included with every license.

Cookies. The short version.

Essential cookies keep the cart and theme working. Analytics only fire if you say yes. Read our policy.