Tracking with GA4 and Google Ads
Cookiemark sets up GA4 events, Google Ads conversions and the tags of other platforms in your own Tag Manager container. The Tracking tab shows them as Tag Manager does, as tags, triggers and variables. You check every change before it goes live, and it all stays in your container.
The workspace: tags, triggers and variables
The Tracking tab of a domain shows the workspace Cookiemark tracking in your container, with the same three lists as Tag Manager: Tags, Triggers and Variables.
- A trigger fires when something happens on your site: a form submission, an appointment booked through a booking tool, a tap on a phone number, a WhatsApp or e-mail link, a download, a visit to a thank-you page, a purchase, or an event your site pushes to the dataLayer.
- A tag fires on that trigger and sends something somewhere: an event to GA4, a conversion to Google Ads, an event to Meta or another platform, or code of your own. A trigger can have several tags, and a tag can fire on several triggers.
- A variable is a value they read, such as your GA4 measurement ID, the default currency, a dataLayer key or a field of a form.
Tags that run on every page use Tag Manager's built-in triggers, such as Initialization and All Pages, or a Cookiemark consent trigger, such as Consent for marketing. Everything has the name it gets in Tag Manager, so what you see here is what you find there.
Google Ads gets a conversion tag of its own for each trigger, with its own conversion action, so it credits the click with its own attribution.
Other platforms and your own tags
Besides GA4 and Google Ads, Cookiemark sends to Meta Pixel, Microsoft Ads, LinkedIn Insight, TikTok Pixel and ChatGPT Ads, and loads Microsoft Clarity and Hotjar for heatmaps and recordings. Add one with New tag: when its ID is not there yet, Cookiemark asks for it first and keeps it as a variable.
For each platform you fill in its ID. Cookiemark puts the platform's base code on every page, with a page view, and sends each conversion as the platform's standard event, which you can change. A platform that your container loads already is not loaded twice.
With Custom HTML you add code of your own, such as a chat widget. Cookiemark checks it before it goes to Tag Manager: every script closed, and JavaScript that works. You choose the consent it waits for, and the trigger it fires on.
Before you start
- A Google connection. An owner or admin connects the Google account that manages the container. Press Connect Google on the Tracking tab, on the Google and GTM tab, or under Settings, Integrations. We ask only for access to Tag Manager.
- A container that runs on your site. Choose it on the Google and GTM tab. The Tracking tab warns you when the last scan did not see that container on your site, because tags in it would never run.
- A GA4 measurement ID, a Google Ads conversion ID, or both. For Google Ads you also need a conversion label for each conversion action. The next section shows where to find them.
- Consent + Tracking on the domain, or a domain in its 14-day trial. You choose the plan per domain, under Settings of the domain. People at an agency client who may edit can set up the tags, and the agency puts them in Tag Manager.
Does your site have no Tag Manager yet? Create a container at tagmanager.google.com and choose it on the Google and GTM tab. Enter its ID in the Container ID field there, and Cookiemark loads it on every page. Who loads the container explains the choice.
Finding your IDs
| What | Looks like | Where you find it |
|---|---|---|
| GA4 measurement ID | G-ABC123XYZ | In GA4 under Admin, Data streams. Open the stream of your site. |
| Google Ads conversion ID | 123456789 | In Google Ads under Goals, Conversions. Open a conversion and choose Tag setup, Use Google Tag Manager. |
| Google Ads conversion label | kq3XCJ7h0ZQbELi4 | On the same screen, below the conversion ID. Every conversion action has a label of its own. |
You may paste the whole code from Google Ads, such as AW-123456789/kq3XCJ7h0ZQbELi4. Cookiemark splits it into the conversion ID and the label. When you paste a GA4 or Tag Manager ID where a Google Ads ID goes, the Tracking tab tells you.
Cookiemark offers the IDs it found, as a button under the field. It looks on your site during a scan, and in the tags of your container. A conversion ID kept in a constant variable is read through that variable.
Pausing a tag
Each tag in the list has a pause button. A paused tag goes to Tag Manager paused: it is in your container but does not fire. The button turns yellow while the tag is paused. Press it again to switch the tag on.
The pause button of a trigger pauses all its tags at once. Like any change, a pause reaches your site once you prepare it in Tag Manager and publish.
Setting up a tag
Choose New tag, or a tag in the list. The panel follows Tag Manager's order: the tag type and where it sends to, its fields, and under Triggering the trigger it fires on.
- GA4 event: the event name, and a value with its currency.
- Google Ads conversion: the conversion label, the value, and customer data for enhanced conversions. The panel shows the category and the count to choose when you create the conversion action in Google Ads.
- Meta, TikTok, Microsoft Ads and ChatGPT Ads: the platform's standard event, with the trigger's own value when it has one.
- LinkedIn: the conversion ID of an event-specific conversion.
- Custom HTML: your own code and the consent it waits for.
A tag keeps its type and the trigger it was made on; its event, label and value come from that trigger. Under Triggering, Add trigger opens a list to choose one from, with New trigger at the top; the minus takes one off, the trigger it was made on too. A tag without triggers does not fire. In a trigger, Add tag does the same from the other side. A paused trigger fires none of its tags; a tag whose triggers are all paused goes to Tag Manager paused.
Under Exceptions, add a trigger that stops the tag, as Tag Manager does with blocking triggers. An exception only stops the tag when it fires at the same moment, such as a dataLayer event with a condition on the event the tag fires on.
A trigger whose tags also fire on other triggers cannot be deleted, as in Tag Manager: delete those tags, or take the other triggers off them, first. A renamed trigger keeps its place in Tag Manager, and so do its tags: they show as modified, not as deleted and added again.
Cookiemark changes its own tags, triggers and variables. When someone changes one of them in Tag Manager, the bar at the bottom of the page says which, and Prepare in Tag Manager asks before it replaces that change.
Setting up a trigger
Choose New trigger and its type: a form submission, a click on a phone, e-mail or WhatsApp link, a page view, a custom event from the dataLayer or a purchase. For a page, fill in the path, such as /thanks. A click on a phone, e-mail or WhatsApp link counts every such link; untick All phone links to count only the links to one number or address that the scan found. For a dataLayer event, choose one of the events Cookiemark saw on your site or type its exact name and, if you like, a condition and the keys that hold the value, the currency and the order number. Then add a tag to it.
For an appointment, choose the booking tool, or any booking tool, and if you like one service by its ID. For a download, every file counts, or only the files whose name contains a word. At the top of the tab, Detected tracking moments lists the forms, booking tools, chats, clicks and dataLayer events Cookiemark found, what is not measured yet first. Add trigger there starts a trigger for one of them, filled in.
There are more moments to count. A chat: a visitor opens it, starts a conversation or leaves their details, in Tawk.to, HubSpot, Intercom, Crisp, Tidio, LiveChat, Zendesk and 12 other chat tools. A route: a click to Google Maps, Apple Maps or Waze. A platform: a click to Thuisbezorgd, Booking.com, bol, an app store and the like. A phone number or e-mail address that a visitor copies counts as a click on it, when you tick that. And a form that somebody started and left without sending is one event of its own, with the field they were in last.
Every trigger Cookiemark makes fires on an event of the Cookiemark tag: a successful form submission, a booking, a click, a thank-you page. So Tag Manager counts what Cookiemark confirmed, and a reload of a thank-you page counts no second time.
Variables
Under Variables are the IDs of your destinations, the default currency, the data layer variables your triggers read and Tag Manager's built-in variables. Change an ID there and every tag that sends to it follows. A variable that tags use cannot be removed: remove those tags first.
With New variable you add one of your own: a constant, a data layer variable, a form field or an element on the page, such as the order total. Choose it in the fields of a trigger. Variables that belong to one tag, such as its label, are under Set in a tag and are edited in that tag.
How Cookiemark finds triggers
When you add a trigger, Cookiemark offers what it saw on your site. That comes from two places: the scan, and the visits of real people.
The scan
Every full or quick scan of your site looks at the things you might count: forms and the kind of fields in them, links to call, mail or WhatsApp, and booking and chat tools. It also notes the events in your dataLayer and the names of their keys, the Google IDs on the page, and links to sign up, log in or see prices.
Real visits
A scan cannot fill in your forms or click your buttons. On a domain with Consent + Tracking, the Cookiemark script therefore reports what your visitors do:
- a form submission that succeeded, or a click on Submit;
- a click on a phone number, an e-mail address or a WhatsApp link;
- a thank-you or order page that somebody landed on;
- an event pushed to the dataLayer, also by gtag.js.
This finds forms in a popup and pages the scan did not reach.
What Cookiemark never reads
Cookiemark reports names and kinds only. It never reads what anybody typed, and never a value from the dataLayer: only the names of the keys. A form field is known by its kind, e-mail or phone, and by where it sits in the form. That is all a Google tag needs to find the field again for enhanced conversions.
The report sets no cookie, stores nothing in the browser and has no visitor ID, so it does not wait for the banner. Each report goes out once per page at most. A report the dashboard knows already goes out only now and then, to keep its date current. Visits by our own scanner are left out.
Forms
For more than 20 form tools, such as Contact Form 7, WPForms, Gravity Forms and Elementor, a form counts only once its submission succeeded. A click on Submit with an error in the form does not count. The full list is under Form events.
For any other form, such as one your site builds itself, Cookiemark watches the page after a click on Submit. A submission counts when:
- the browser goes on to the next page to send it, or the server accepts it;
- the form goes away or empties its fields, without an error;
- a confirmation appears, or the address changes to a thank-you page;
- your site pushes a success event such as
generate_leadto the dataLayer; - a thank-you text appears. This counts last, because words change and differ per language.
Where a confirmation appeared once, Cookiemark remembers that element for the form. The next submission then counts by that element, in any language. Without any of these signs, Cookiemark sees only the click on Submit.
A thank-you page counts more exactly, if the form has one. A newsletter form is suggested as a sign-up, with the GA4 event sign_up, because a sign-up is not a new customer.
When you publish tracking that counts forms, Cookiemark switches on Send form events on the Google and GTM tab. It publishes the domain for you when the domain is live.
What lands in Tag Manager
Everything goes into one workspace, called Cookiemark tracking, in the container you chose. Every tag, trigger and variable that Cookiemark makes has a name that starts with Cookiemark -, and a note that says Cookiemark manages it. The names Cookiemark gives in Tag Manager, Google Ads and GA4 are in English, whatever the language of your dashboard, as is usual in those tools. A name you type yourself stays as you typed it.
| Name in Tag Manager | What it is |
|---|---|
Cookiemark - Google tag and your GA4 ID | The Google tag for GA4, on Initialization - All Pages. Only when your container has no Google tag for that ID yet. |
Cookiemark - Conversion Linker | On All Pages, for Google Ads. Only when your container has no Conversion Linker yet. |
Cookiemark - GA4 - and the trigger name | A GA4 event tag. |
Cookiemark - Ads - and the trigger name | A Google Ads conversion tag, once it has its label. |
Cookiemark - and the trigger name | The trigger: a custom event on an event of the Cookiemark tag, such as cookiemark_form_sent or cookiemark_booking, or on an event of your site. |
Cookiemark - GA4 measurement ID | A constant variable that holds your GA4 measurement ID. |
Cookiemark - Currency | A constant with the default currency. A tag with a currency of its own gets one more, such as Cookiemark - Currency GBP. |
Cookiemark - Google Ads label - and the trigger name | A constant with the conversion label of that tag. |
Cookiemark - Google Ads remarketing | On All Pages, for audiences of visitors who allowed personalised ads. Only when you add it. |
Cookiemark - and the platform, such as Cookiemark - Meta Pixel | The platform's base code, once the visitor allows its consent category. |
Cookiemark - Consent marketing, statistics and preferences | The triggers that fire on every page as soon as the visitor allows that category. |
Cookiemark - DOM Ready and Cookiemark - Window Loaded | Page triggers for a tag of your own that fires at that moment. Only when a tag uses them. |
Cookiemark - Google Ads conversion ID | A constant variable that holds your conversion ID. Every conversion tag uses it, so a new Google Ads account means one change. |
Cookiemark - DL - and a key | A Data Layer Variable, for the form ID, a value, a currency or an order number. |
The trigger name with customer e-mail, customer phone or user data | The variables for enhanced conversions. |
The trigger name with amount or order number | The variables that read an order page. |
The GA4 events follow Google's recommended names where one fits: generate_lead for a form or a request, sign_up for a newsletter or a new account, and purchase for an order. A click sends click_phone, click_email or click_whatsapp. An event of your own keeps its own name. A form also sends its form_id.
Preview and publish
- When something changed, a note in the bottom right corner says how many changes are not in Tag Manager yet. Show lists them, and Prepare in Tag Manager puts them in the workspace Cookiemark tracking. Google lets us make only a few requests a second, so this can take up to a minute.
- Preview in Tag Manager opens the workspace. Tag Manager's preview shows which tags fire on your site.
- Publish in Tag Manager makes a new container version called Cookiemark tracking and puts it live. Cookiemark then starts a quick scan of your site to check the result.
Discard removes the changes from the workspace, and nothing goes live in Tag Manager or on your site. To undo a publish, publish the version from before in Tag Manager under Versions.
Cookiemark changes only what it made itself. The tags, triggers and variables of anybody else stay as they are.
Nothing counts twice
A conversion that counts twice makes your campaigns look better than they are. Before it adds anything, Cookiemark reads your container and your site.
- Tags that measure already. A suggestion that a tag in your container counts already is marked Already measured by, with the name of the tag.
- The Google tag. When your container has a Google tag for your GA4 ID, Cookiemark uses it. When gtag.js loads GA4 on the page itself, outside Tag Manager, Cookiemark adds only the events, so page views do not count twice.
- Google Ads tags. A Google Ads tag with the same label stays, and Cookiemark adds no second one. The list of changes to publish warns you about other Google Ads tags for the same account, so you can check what they count.
- Forms and thank-you pages. Cookiemark does not suggest a thank-you page next to forms it counts, or the same request would count twice.
- Purchases. The purchase event your shop pushes is used as it is. With an order number, Google counts each order once, even when somebody reloads the page.
Forms
Whether your forms are measured, Lead Guard, which tells you when one stops working, and the mail they send are on Forms and Lead Guard.
Values and currency
A value tells GA4 and Google Ads what an event or conversion is worth. They add it up, and Google Ads can bid on it. There are three ways to give one.
- A fixed value. In a GA4 or Google Ads tag, choose Fixed value and fill in what one is worth to you on average, such as 50 for a quote request, with its currency. Choose No value to count without a value.
- From the dataLayer. A purchase event with the standard GA4 ecommerce data brings its own value, currency and order number. For an event of your own, choose the keys in its trigger, under Value, Currency and Order number.
- From an order page. When visitors land on a WooCommerce order page that shows the amount and the order number, Cookiemark reads both from that page.
In each tag of a purchase, such as GA4, Google Ads or Meta, you choose what the purchase is worth to it: Without VAT and shipping, what the products bring in, or The order total, what the customer paid. Without VAT and shipping is what Google counts as revenue, and gives Google Ads a true return on ad spend. Cookiemark works it out in Tag Manager from the value, tax and shipping of the purchase event, so it holds for every shop. A new setup starts without VAT and shipping; a setup from before keeps the order total until you change it.
Take a site that pushes this event when somebody asks for a quote:
dataLayer.push({
event: 'quote_requested',
quote: { value: 250, currency: 'EUR', id: 'Q-1042' }
});Count the event quote_requested, with the value from quote.value, the currency from quote.currency and the unique number from quote.id. With a unique number, the same request never counts twice. You can also count an event only when a variable has a certain value.
A new tag starts in the Default currency, which you find under Variables: EUR, USD, GBP, CHF, SEK, NOK, DKK, PLN or CZK. A value from the dataLayer or the order page brings its own currency.
In a shop, the steps towards the checkout, such as adding to the basket, go to GA4 only. They are steps on the way, not conversions.
Enhanced conversions
With enhanced conversions, Google Ads can credit more conversions to your ads.
The Google Ads tag reads the e-mail address and phone number at the conversion, from the form or from the dataLayer. It sends them hashed, only when the visitor allowed marketing. Cookiemark never reads them itself: it all happens in the visitor's browser.
- E-mail addresses are trimmed and put in lower case, as Google asks, and Gmail addresses lose the dots before the @.
- Phone numbers go in international form. For numbers typed without a country code, you choose the country, so 06 12345678 becomes +31612345678.
- A value that is a SHA-256 hash already goes as it is.
Some form tools, such as Contact Form 7, empty the form the moment it is sent, before the Google Ads tag reads it. For a form whose customer data your published tracking sends, the Cookiemark tag therefore hashes the e-mail address and phone number at the submit, only when the visitor allowed marketing, and passes the hashes along with cookiemark_form_sent. The tag reads the field first and falls back on those hashes.
The tick is in the Google Ads tag, when its trigger has an e-mail or phone field, or a dataLayer key that carries one. Tick it and the fields appear under it: choose which field holds the e-mail address, the phone number and the rest. Google Ads calls this user-provided data. After you publish, switch it on in Google Ads as well, under Goals, Settings, Enhanced conversions. Choose Google Tag Manager there and accept the terms. Without that, Google Ads ignores the fields.
Your Cookiemark privacy statement says this by itself once you publish: it names the companies that get the hashed details, and says when Google also gets a name and address.
Bookings
A booking trigger has its customer data set up already. The Cookiemark tag takes the e-mail address and phone number from the booking tool, normalises them and hashes them in the browser, only when the visitor allowed marketing. Only the hashes go into the dataLayer, never the address or number itself, and never a name.
Bookings
A booking through a booking tool on your site is one event, cookiemark_booking, with what the tool tells the page: the tool, the service, the time, the length, the price, the number of people, the branch and a reference. A member of staff goes by an ID. The reference is hashed: it keeps the same booking from counting twice, and it opens nothing.
Cookiemark recognises 57 booking tools: calendars and scheduling tools, tools for salons, restaurants and hotels, and WordPress booking plugins. 34 of them tell the page when a booking is made. For Zoho Bookings, Zcal and Timely, Cookiemark reads the booking from the address of the thank-you page they send visitors to. Measure the others by that thank-you page.
GA4 shows parameters such as booking_tool and booking_service in its reports only once they are registered as custom dimensions. With GA4 connected, Register in GA4 does that for you.
Purchases in the Shopify checkout
Shopify runs its checkout apart from your theme. Your Tag Manager container and the Cookiemark banner do not load there, and Shopify tells the purchase only to the pixels under Customer events. For a Shopify shop, the Tracking tab shows a custom pixel to add there, made from your tracking.
- In your Shopify admin, open Settings, then Customer events.
- Choose Add custom pixel, name it Cookiemark and choose Add pixel.
- Under Customer privacy, set Permission to Not required. The pixel then loads for every visitor, and the tags in it wait for the consent they need.
- Copy the code from the Tracking tab and paste it into the Code box.
- Choose Save, then Connect.
In the checkout, the pixel loads your container and sends it begin_checkout, add_shipping_info, add_payment_info and purchase as GA4 ecommerce events, with the order number, the amount, tax, shipping and the products. On the rest of your shop it passes view_item, add_to_cart, view_cart and search to the page, where the Cookiemark script puts them in the dataLayer of your container.
The banner passes each choice to Shopify's Customer Privacy API, and the pixel sets Consent Mode from it. Tags of other platforms wait for consent for marketing, as on the rest of your site.
When your tracking uses customer data for enhanced conversions or matching, the pixel adds the customer's e-mail address, phone number, name and address to the purchase. Cookiemark itself hears only that a checkout step happened, never a value.
Tag Manager's preview does not reach the checkout, because Shopify runs pixels in a sandbox of their own. Check a test order in GA4 under Reports, Realtime, or with Shopify's Pixel Helper. After you change your tracking, copy the code again and paste it over the old one.
Purchases on the Squarespace order page
Squarespace lets no code into its checkout, and the page after it does not tell the Cookiemark script what was ordered. For a Squarespace shop, the Tracking tab shows a code for the order page boxes of Code injection, made from your tracking.
- In Squarespace, open Pages, then Website tools and Code injection. On an older site you find it under Settings, Advanced.
- Copy the code from the Tracking tab and paste it into the Order status page box, and into the Order confirmation page box as well.
- Choose Save.
Squarespace fills in the order number, the total and the e-mail address, and the code puts the order in the dataLayer as the GA4 purchase event, in the currency of your tracking. Squarespace gives no tax, shipping or products to the code, so the purchase goes without them. Each order counts once, however often the page is opened in the same browser.
Purchases on the Lightspeed thank-you page
The thank-you page of a Lightspeed shop does not tell the Cookiemark script what was ordered. For a Lightspeed eCom shop, the Tracking tab shows a code for the Tracking box of Web extras, made from your tracking.
- In your Lightspeed back office, open Settings, then Website settings and Web extras.
- Copy the code from the Tracking tab and paste it into the Tracking box, under any code that is there already.
- Switch Status on and choose Save.
Lightspeed fills in the order number, the amounts, tax, shipping, the discount code and the products, and the code puts the order in the dataLayer as the GA4 purchase event. Each order counts once, however often the page is opened in the same browser.
When your tracking uses customer data for enhanced conversions or matching, the code on either page adds the customer's e-mail address, and on Lightspeed the phone number, as SHA-256 hashes made in the browser, only when the visitor allowed marketing. The address and number themselves never go into the dataLayer, and neither does a name. After you change your tracking, copy the code again and paste it over the old one.
Consent
Google's tags that Cookiemark adds have Consent Mode built in. They read what the visitor allowed in the banner, as Cookiemark tells Google. Cookiemark adds no extra consent settings to them.
Other platforms and your own Custom HTML tags have no Consent Mode. Cookiemark gives each of them a consent check in Tag Manager: advertising platforms wait for marketing cookies, Clarity and Hotjar for statistics, and your own tags for the kind you chose. Their code loads the moment the visitor allows it.
Without consent the tags set no cookies. Where they run, they send Google a ping without cookies, and Google Ads uses those to estimate the conversions it cannot see. An extra consent check would stop those pings as well.
How much reaches Google before a choice depends on the mode you chose for Consent Mode. Basic or advanced explains the difference.
After you publish
A few things are left, and only you can do them, in your own Google accounts. Next in Google on the Tracking tab lists the ones that are still open.
- Mark the key events in GA4. In GA4 under Admin, Key events, add the events of your GA4 tags as key events. GA4 shows a new event within a day.
- Switch on enhanced conversions in Google Ads, if you use them.
- Check the status in Google Ads. Under Goals, Conversions, each conversion action should say Recording conversions within a few days. Inactive or No recent conversions means a conversion label is wrong, or nothing was counted yet.
- Test it once yourself. Open your site, accept the cookies and send a form or tap a phone number. In GA4 under Reports, Realtime, the event shows up within a minute.
The status of each tag
Each tag shows where it stands: Live when it is in the published version of your container, Pending when it waits in the workspace, Not in Tag Manager when it is new or changed here, and Label needed for a Google Ads tag without its label. A trigger shows the status of its least finished tag, and when it last fired on your site: Fired with the date, or Not fired yet.
Changing or removing it later
Open a tag, trigger or variable in the lists to change it, and choose Remove in its panel to take it out. Removing a trigger removes its tags. A published trigger you removed stays in the list as Removal pending, with Undo, until you publish.
Then choose Prepare in Tag Manager again. Cookiemark brings its own tags up to date and removes the ones it no longer needs.
Changes you make by hand to Cookiemark's own tags, triggers and variables are replaced the next time you publish tracking from Cookiemark. Make the change in Cookiemark instead, or build your own tag under another name.
To take all of it out, delete the tags, triggers and variables whose names start with Cookiemark - in Tag Manager, and publish. Every publish and every workspace you discarded stays listed under Versions published from Cookiemark on the Tracking tab.
Questions
Does Cookiemark see what my visitors type?
No. Cookiemark knows a form field only by its kind and its place in the form. For enhanced conversions, Google's tag reads the field in the visitor's browser and sends it hashed to Google.
Why does Cookiemark not suggest something it saw?
It may be set up already: then it is in the lists. A thank-you page is not suggested next to forms that are counted, so a request does not count twice. And a trigger that a tag in your container fires on already is suggested with that tag named.
My site loads GA4 with gtag.js, not with Tag Manager. Does that work?
Yes. Cookiemark leaves gtag.js as it is and adds only the events, to the same measurement ID. The container still has to run on your site.
Can I see what Cookiemark made in Tag Manager?
Yes. Everything is in your own container, under names that start with Cookiemark -. You or your agency can open, preview and check every tag. See the Google Tag Manager page for how Cookiemark and Tag Manager work together.