Clixcel Free tools

Free tools

52 tools, free to use

Analytics3

SEO9

Web performance3

Paid ads4

Social5

CRO1

Web development7

Local SEO2

Email2

E-commerce11

Documents5

See all tools on one page

Free tool · No sign-up · Nothing stored

Free GA4 event code generator

Build the data layer and gtag.js code for GA4 events: purchase, add to cart, generate lead, sign up and every other recommended event, with items, value and currency checked against Google's rules.

How to use this tool

Sent as its ISO code with any value.

Items

Extra parameters

Your own parameters, such as form_name or plan. Register them as custom dimensions in GA4 to see them in reports.

Set it up in Tag Manager

      Why event code goes wrong

      Most GA4 tracking problems are small mistakes in the event itself: a value sent as text with a currency sign, a missing currency, an order ID left out so refreshed thank-you pages count as new sales, or items from one event carried into the next. Revenue then looks wrong in GA4 and in the Google Ads conversions that import it, and nobody notices for weeks.

      This generator writes the code in the shape Google documents for each recommended event, and checks it as you type: the event name, required parameters, the currency, numbers and items. Copy the version for Tag Manager or for gtag.js, whichever your site uses.

      Where to put the code

      • purchase: on the order confirmation page, once per order, with the real order ID and totals from your shop.
      • add_to_cart and view_item: when the button is pressed or the product page loads, with the product's details.
      • generate_lead and sign_up: after the form is sent successfully, not when the button is clicked.

      Then check that GA4, Consent Mode and your ad tags are set up properly with the tracking and Consent Mode checker, and tag your campaign links with the UTM builder so the events are credited to the right source.

      Questions

      What are GA4 recommended events?

      Event names and parameters Google has defined for common actions, such as purchase, add_to_cart, generate_lead and sign_up. Use them exactly as written and GA4 fills its built-in reports with them, such as monetisation and the ecommerce funnel. Custom names do not appear there.

      Should I use Tag Manager or gtag.js?

      Use the Tag Manager code if the site runs Google Tag Manager: the page pushes the event to the data layer and a tag in Tag Manager sends it to GA4. Use gtag.js if the GA4 tag sits directly on the page. Do not send the same event both ways, or it is counted twice.

      Why clear the ecommerce object first?

      The data layer keeps what was pushed earlier on the page. Pushing ecommerce: null before each ecommerce event stops items from one event, such as view_item, leaking into the next, such as add_to_cart. Google's own examples do the same.

      Does value need a currency?

      Yes. GA4 ignores value, and the revenue that goes with it, when currency is missing. Use the three-letter ISO code, such as USD, EUR or PKR, and send value as a number without a currency sign or thousands separator.

      What are the rules for custom event names?

      Up to 40 characters, starting with a letter and using only letters, numbers and underscores. Names starting with google_, ga_ or firebase_ and names GA4 uses itself, such as session_start or first_visit, are reserved. Each event can carry up to 25 parameters.

      How do I check the event works?

      Open Tag Manager's preview (Tag Assistant), do the action on your site, and check that the tag fires with the right values. Then open GA4, Admin, DebugView to see the event arrive with its parameters before it shows in reports a day later.

      Want tracking you can trust?

      We set up GA4, Tag Manager, server-side tagging and conversion tracking for Google and Meta ads, and check the numbers against your sales.

      Talk to our analytics team