FAQ on DataLayer, GA4, Google Ads and Consent Mode

A short answer here. The full guide is the link at the top of each group; if a container exists, the answer points to the product page.

Purchase and delivery

Prices VAT included and JSON delivery after payment. The catalog is in the Shop.

Are you a team from Google Kraków?

Yes. Easy Tag is the spin-off of the Italian team that worked on tags in Kraków. The story is told on About.

What do I receive after purchase?

The Google Tag Manager container JSON file and the instructions, by email. Ready-made containers are in the Shop.

Do prices include VAT?

Yes. All listed prices are VAT included.

dataLayer initialization and integrity

What window.dataLayer is and why it must not be reassigned. Guide: DataLayer architecture.

What exactly is the dataLayer in the Google Tag Platform?

The dataLayer is a global JavaScript array, by default window.dataLayer, that passes variables and events from the page to Google Tag Manager and to gtag.js.

Why is the dataLayer initialized with window.dataLayer = window.dataLayer || [] before the snippet?

To create the array only if it does not exist, without deleting pushes that are already there. GTM and gtag.js then find a valid instance at startup. The Google Tag Manager snippet must load after this line, as described in the installation section of this guide.

What happens if you overwrite window.dataLayer = [] or window.dataLayer = {} after load?

You break the reference on which GTM and gtag.js attached listeners and the internal queue.

  • Events already in the queue are lost.
  • Tags do not fire, or they fire with inconsistent data.
  • Do not use an object {}: the dataLayer is an array, not a map.

FIFO queue and dataLayer.push

Message order and the role of the event key. Guide: DataLayer architecture.

How does the dataLayer process messages?

With a FIFO queue (First-In, First-Out): pushes are read one at a time, in arrival order. If the message contains event, Google Tag Manager evaluates the triggers and fires the linked tags before moving to the next message.

What does it mean that a dataLayer.push() from an external script or from a Custom HTML tag is queued?

Execution is asynchronous relative to events already in the queue. A variable written without event may not be visible yet when the next event fires. To stay in sync, always send a dedicated event key and use a Custom Event trigger. That is how Phone Click Tracking and the Email Tag publish the click.

Why is it discouraged to put gtag.js inside a custom HTML tag in GTM?

Because it duplicates the tag lifecycle, can conflict on the queue and on gtag(), and skips GTM's native controls, including consent. Use the native tag templates for Google Ads, Google Analytics 4 and Floodlight.

How do you send an event and several variables in a single push?

With one object: dataLayer.push({event: 'customize', color: 'red', conversionValue: 50}). All keys enter the dataLayer state and can be read by tags fired by that event. Do not split the value and the event name into two different pushes.

What happens if you push a variable with the same name as an existing key?

The new value overwrites the previous one in the current state, from that point in the queue onward. Messages already processed are not rewritten.

How long do variables pushed into the dataLayer stay active?

They remain available for the whole time spent on that page, until you overwrite them or reset the state. Across pages they must be published again on every load, with the same name: visitorType on one page and visitor_type on another are two different keys.

What is the difference between dataLayer.push(function) and gtag(...)?

If you pass a function to dataLayer.push(function(){ ... }), this points to GTM's abstract data model (this.set, this.get, this.reset). gtag(function(){ ... }) is not a valid command: the function is ignored.

Data model, custom name and syntax

Data model methods and syntax errors on the push. Guide: DataLayer architecture.

What is this.reset() for inside a function passed to dataLayer.push()?

It clears the state accumulated in the data model. It is useful on pages that stay open for a long time and in single-page applications, so you do not carry values from the previous view. The SPA pageview must then be sent again as described in the Google Analytics 4 guide.

How do you use this.set() and this.get() in custom dataLayer methods?

They read and write key-value pairs on the abstract data model, in a controlled way. Example: this.set('time', new Date()) and, in a later step, this.get('time'). They do not replace a dataLayer.push with event when you need to fire a tag.

Can dataLayer be renamed?

Yes. Change the array name in the snippet, pass l=myNewName in the GTM script URL and align every call to window.myNewName.push(...). If even one integration keeps writing to dataLayer, events split across two queues.

What are the most common syntax errors on dataLayer.push()?

  • datalayer.push instead of dataLayer.push (the L is uppercase).
  • Keys with special characters, such as new-variable, written without quotes.
  • Malformed JSON: trailing comma, single quotes where the parser expects strict JSON, unclosed brackets.

Google tag, checks and a single dataLayer

One array per page, Tag Assistant and network domains. Guide: DataLayer architecture.

How do you check the dataLayer state in real time?

With Google Tag Assistant on tagassistant.google.com, or with Google Tag Manager Preview mode. For each event in sequence you see the dataLayer values and the consent state. Consent is covered in more depth in the Consent Mode guide.

What is the Google tag (gtag.js) and how does it connect to multiple destinations?

It is a single JavaScript framework that collects data and routes it to multiple destinations: Google Ads, Google Analytics, Floodlight and others, through a TAG_ID or linked configurations. In a GTM container the same role is played by native tags, not by a second copy of gtag pasted on the page.

What is the role of the ID prefix (GTM-, G-, AW-) in the script URL?

It tells the loader which kind of container it is starting and which permissions to apply.

  • GTM- is a Google Tag Manager container.
  • G- is a Google Analytics 4 property.
  • AW- is a Google Ads account.

Why is gtag('config', ...) marked as deprecated in newer snippets?

Google is moving destination configuration into the Google Tag Manager interface and, on the page, toward gtag('set', ...). A gtag('config') that is already published stays backward compatible: do not remove it mid-migration without a measurement plan.

How do grouping and routing work in gtag.js?

You can centralize shared parameters and send an event only to some destinations, for example a Measurement ID G- or an account AW-, instead of sending everything everywhere. It is the same principle as the send_to parameter explained in the Google Ads native tag guide.

How do you check in the Network tab that the tag is sending data?

Filter requests by domain.

  • googletagmanager.com loads the container.
  • google-analytics.com or analytics.google.com carry GA4 hits.
  • googleadservices.com and Google advertising domains carry Ads.
  • doubleclick.net appears with Floodlight.

How does debugging change with server-side tagging?

In the browser you see requests to your tagging endpoint, usually a first-party subdomain. Hits to the final Google Ads and Google Analytics servers leave from the server container, not from the user's browser.

What is the Google tag gateway for advertisers?

It is a setup that routes tag requests through a first-party path you control. It makes measurement more continuous when the browser limits third-party scripts, always in line with Consent Mode.

How is tagging handled on AMP pages compared with the standard web?

AMP has native components for tags and for GTM, with their own limits. GTM for AMP does not cover Google Analytics the way the web does: you need dedicated AMP snippets and you must check that cid and gclid are passed to non-AMP pages.

How do you filter traffic from CMS integrations, for example Shopify, in Google Analytics?

With data filters or dedicated exclusions, so automatic CMS events and internal traffic do not inflate sessions and conversions. The funnel you want to read in reports is the E-commerce Tracker's, not the theme's test funnel.

Why use a single dataLayer per page even with multiple tags?

A single array keeps one timeline. Two separate queues make a tag read missing or stale values. The same applies when GA4, Google Ads and the Consent Mode v2 tag live on the same page.

Event types and page_view

Automatic, enhanced measurement, recommended and custom. Guide: Google Analytics 4.

What is the difference between automatic events, enhanced measurement, recommended events and custom events?

They are four levels, from the most generic to the most specific to you.

  • Automatic: they fire without extra configuration.
  • Enhanced measurement: scroll, outbound clicks, site search, video, downloads.
  • Recommended: Google's standard names and parameters, useful for reports and features.
  • Custom: actions that only your business defines.

Enhanced measurement does not replace the E-commerce Tracker funnel.

Why does Google Analytics send page_view when the tag starts?

Because the Google tag configuration sends a page_view hit by default, unless you turn it off with send_page_view: false. You turn it off in SPAs and when the dataLayer publishes the pageview, as explained in the DataLayer guide.

How do you send an event with gtag.js and which parameters does it accept?

Syntax: gtag('event', 'event_name', { parameter: value }). The second argument is the event name. The third is an object of event parameters or of routing toward a destination.

Parameters, conversions and e-commerce

Key events, purchase and the items array. Product: E-commerce Tracker.

What is the difference between event parameters and user properties?

Event parameters describe that single occurrence: currency, value, transaction_id, search_term. User properties describe who performs the action and persist on later interactions: plan, customer type, region.

How do you track conversions, that is key events, in Google Analytics?

You send the event with the correct name and parameters, then mark it as a key event in the GA4 property. Typical names: purchase, generate_lead, sign_up. For phone, email and WhatsApp the signal comes from the Phone Click Tracking, Email Tag and Contacts 3-in-1 containers.

Which parameters are critical for the purchase event?

  • transaction_id, unique, so the same order is not counted twice.
  • value, a number, not a string.
  • currency, a three-letter ISO code, for example EUR.
  • items, with item_id, item_name, price, quantity.

They are the same fields as the E-commerce Tracker.

Why must transaction_id be unique on the purchase event?

Because GA4 deduplicates orders with the same id. A reload of the thank-you page or a double send must not become two purchases.

How is the items array built in e-commerce events?

It is a list of objects. Each object is an item of the action (view_item, add_to_cart, begin_checkout, purchase). Useful fields: item_id, item_name, item_brand, item_category, price, quantity, index.

What is the difference between view_item_list and select_item?

view_item_list measures the view of a grid or category, with item_list_id and item_list_name. select_item measures the click on an item in that list, before the product page.

How do you track the purchase funnel with recommended events?

In sequence, published by the dataLayer and not by theme CSS selectors:

  • view_item
  • add_to_cart
  • view_cart
  • begin_checkout
  • add_shipping_info and add_payment_info
  • purchase

The package that covers them is the E-commerce Tracker. The data layer is in the DataLayer guide.

What happens if value or price arrive as a string, for example "99.00"?

Reports and monetary metrics may add the value incorrectly or drop it. value, price and quantity must be sent as numbers.

How are refunds handled in Google Analytics?

With the refund event and the same transaction_id as the original order, plus currency and the refunded value, or items if the refund is partial.

Leads, SPAs, data quality and limits

Leads, single-page applications and personal data you must not send. Guide: Google Analytics 4.

How do you send lead-generation events in a standard way?

With recommended events: generate_lead (also with currency and an estimated value) and, in qualification flows, qualify_lead or close_lead. The click on phone, mailto and WhatsApp stays its own event: see Contacts 3-in-1.

How do you track single-page applications, where there is no new HTTP load?

You turn off the automatic page_view if the first hit would be a duplicate, and you send a page_view on every view change with updated page_location and page_title. In GTM the same result comes from a dataLayer.push with a dedicated event. Installation detail: DataLayer.

What is the difference between the native GA4 tag in GTM and gtag('event', ...)?

In the native tag you map parameters and variables in the interface, usually after a dataLayer.push. With gtag('event', ...) the call lives in the page script. Together, on the same event, they duplicate hits.

How do you avoid sending personal data in the clear in GA4 parameters?

You sanitize upstream, before the push. No email, phone or other identifying data in URLs, event names or parameters. Consent on these flows is in the Consent Mode guide.

What does it mean to register a parameter as a custom dimension or metric?

GA4 receives the parameter immediately, but you see it in reports and explorations only after you create the custom dimension or metric in the property.

How do you track forms and file downloads?

  • file_download with enhanced measurement, or a dedicated event with file_name, file_extension, link_url.
  • form_start and form_submit, or a custom event only on a confirmed submit, not on a simple button click.

Which naming rules should events and parameters follow?

  • Lowercase snake_case, no spaces.
  • No reserved prefixes: ga_, google_, firebase_.
  • The same name on web and app, otherwise cross-platform reports do not merge.

How do you check that an event arrives with the right parameters?

With DebugView in Google Analytics, together with Tag Manager Preview or Tag Assistant. You check the single event and every attached parameter, not only the report total.

What is the link between GA4 events and remarketing in Google Ads?

If the properties are linked and advertising signals are allowed, GA4 events and audiences are imported into Google Ads for bidding and remarketing. Product remarketing, with feed ids, is Dynamic Remarketing, also explained in the Google Ads native tag.

What happens if an event fires before the tag is ready or before the consent update?

Without a queue or without Consent Mode the hit can be dropped, or it can fire with a restrictive consent state. With GTM or gtag and Consent Mode, the request follows the applied state.

How do you handle multiple properties with the same dataLayer?

By routing each tag to its own Measurement ID G-XXXX, based on the trigger or the destination parameter. The queue stays one; the destinations do not.

Why align event names between site and app?

So that purchase or sign_up is read as the same action on web and app. Different names split funnels and audiences.

How do you avoid filling the page with redundant events?

Write the taxonomy first: only events that serve analysis, funnels, conversions or bidding. Attributes go in parameters, not in ten almost identical event names.

Google Ads conversions and remarketing

Conversion, dynamic remarketing and send_to. Guide: Google Ads native tag.

What is the difference between a Google Ads conversion event and a remarketing event?

The conversion records a valuable action (purchase, lead, call, signup) and feeds reports and bidding, for example Target CPA or Target ROAS. Remarketing collects browsing or product signals to build audiences. The catalog case is Dynamic Remarketing.

How do you send a Google Ads conversion with gtag.js?

With gtag('event', 'conversion', { send_to: 'AW-CONVERSION_ID/CONVERSION_LABEL', value: 0, currency: 'EUR', transaction_id: '...' }). In GTM the same send is done with the native tag, not with custom HTML.

What is the send_to parameter for?

It indicates the AW-... account and the conversion label the action should be attributed to. Without a precise send_to, a site with multiple accounts sends the signal to the wrong destination.

When should you also use transaction_id on Google Ads conversions?

On purchases and on any action the user can repeat by reloading the page. The same id stops the thank-you page from counting two conversions.

How do enhanced conversions work and how do you pass user data?

They add user-provided data (email, phone, name, address) to the conversion tag, processed according to Google's specifications, to recover conversions the cookie alone does not see. They must not be put in the clear in GA4 parameters. Advertising consent is in Consent Mode.

How do you send user data in server-side GTM for Google Ads?

With a User-provided data variable linked to the Google tag, and with the Google Ads User-provided Data Event tag in the server container, using the correct Conversion ID.

What is dynamic remarketing and how does it differ from standard remarketing?

Standard remarketing uses lists of visited pages. Dynamic remarketing sends catalog parameters (value, currency, items with id and google_business_vertical) to show the items viewed or abandoned. That is the scope of Dynamic Remarketing.

Which parameters does retail dynamic remarketing require?

  • send_to toward the correct Ads destination.
  • value and currency.
  • items, and in each element an id identical to the Merchant Center feed product id.
  • google_business_vertical, for retail usually retail.

What happens if the product id does not match the Merchant Center feed?

Google Ads does not match the user to the catalog item. The dynamic ad is not personalized, or it uses a generic fallback.

Why native Google Ads tag templates in GTM and not a custom HTML tag?

Native templates format the parameters, talk to the Conversion Linker, respect Consent Mode and stay aligned with the latest Ads features. Custom HTML reinvents those things, and usually breaks them.

Value, deduplication and advertising consent

Value, transaction_id and ads consent. Guide: Google Ads native tag.

How do you avoid a double conversion if the site has both gtag.js and GTM?

Keep a single system, preferably GTM with native tags, and remove the other send of the same event on the same trigger. Two tags on the same thank-you page count two conversions.

How do you track actions that do not reload the page, such as an AJAX form or a phone click?

The trigger must listen for a dataLayer event emitted only after confirmation: for example form_submitted or phone_click. The ready-made container for the number is Phone Click Tracking; for phone, email and WhatsApp together, Contacts 3-in-1.

What are value and currency for in Google Ads?

They measure the economic return of the conversion and feed value-based strategies: Maximize conversion value and Target ROAS. Without a currency, the value is not comparable.

How do you distinguish variable values and fixed values?

For ecommerce and quotes the calculated value sits in the dataLayer, transaction by transaction: that is the E-commerce Tracker case. For a lead with a constant value you set a fixed amount on the Ads conversion, and you repeat it identically.

What is the difference between importing a conversion from GA4 and using the Google Ads native tag?

The native tag sends the signal directly to Google Ads, with Conversion Linker and enhanced conversions. The GA4 import depends on the key event and on the link between the two products, and it is less suitable when you need the first-party ad click. The native tag model is the subject of this guide.

How do you check that a Google Ads conversion fires without errors?

In GTM Preview or in Tag Assistant you check triggers, variables and the consent state. In Network you look for requests to Google advertising domains, not only the green tag name.

What happens if the conversion tag fires before the variables are ready?

value or transaction_id leave empty. Value, currency and id must be in the same dataLayer.push object that emits the event, or already in the state before that push. The queue is explained in the DataLayer guide.

How is consent handled on conversion and remarketing tags?

With Consent Mode: ad_storage, ad_user_data for user data used in advertising, ad_personalization for remarketing and personalized ads. The detail of the default and update commands is in the Consent Mode guide. The package is Consent Mode v2.

Can you send an event to a single Google Ads account?

Yes. send_to on the tag or on the event limits the destination to that account and that label. Other accounts linked on the page do not receive that conversion.

What is the relationship between the Google tag on all pages and conversion accuracy?

A tag present across the whole site keeps first-party cookies and identifiers along the session. Without it, the Conversion Linker does not see the click on the landing page and attribution gets shorter.

What the linker is for and why the first-party cookie holds measurement up. Guide: Google Ads native tag.

What is the Conversion Linker and what is it for?

It stores ad-click data, such as the gclid, in a first-party cookie, so the conversion tag can find it when the action happens, even pages later.

On which pages should the Conversion Linker fire in GTM?

On all of them, with an All Pages trigger. Any landing page that receives an ad click must be able to save the parameter immediately.

How does the Conversion Linker work in server-side tagging?

In the server container the Conversion Linker tag, usually on All Pages, writes and reads the first-party cookies tied to the tagging server's domain.

Cross-domain, redirects and checklist

Domain, the _gl parameter and redirects that drop the query. Guide: Google Ads native tag.

What is cross-domain measurement and when is it needed?

It is needed when the journey crosses two distinct domains, for example the site and an external checkout, and you want the same session instead of a new user or a self-referral.

What is the difference between subdomains and different domains?

www.example.com and shop.example.com share the parent domain and, if the cookie is set on .example.com, the first-party cookies too. domain-a.com and domain-b.com do not: link decoration is required.

How does the Google tag keep identity from domain-a.com to domain-b.com?

It decorates outbound links and forms with a _gl parameter. The destination domain reads it and saves the state in its own first-party cookies.

Which mistakes make cross-domain fail?

  • A domain is missing from the configuration list.
  • A server-side redirect drops the query, and therefore _gl as well.
  • A script intercepts the click and navigates without letting the link be decorated.

How do you verify the handoff between AMP pages and non-AMP pages?

In a private window, or after clearing cookies, you check that cid and any gclid travel in the _gl parameter and match on the final page. Redirects in between are the first point that breaks.

How do 301 and 302 redirects affect the Conversion Linker and cross-domain?

If the redirect does not keep the query string, gclid and _gl are lost. The chain must be tested on the real arrival URL, not only on the original link.

What is the checklist for robust tagging on dataLayer, GA4 and Google Ads?

  • Initialize window.dataLayer only once, at the top, without reassigning it. Guide: DataLayer.
  • Events with typed parameters, numbers that are really numbers. Guide: GA4.
  • Native tags, not custom HTML, for Ads and Analytics.
  • Consent Mode with default before the tags and update from the CMP. Guide: Consent Mode.
  • Conversion Linker on all pages.
  • A cross-domain test on flows that change domain.
  • A final check in Tag Assistant and DebugView.

If there is no internal time, the scope is the Shop and the 5-hour support, 10 hours or 20 hours packages.

default and update commands

Initial state and the update from the CMP, before tags fire. Guide: Consent Mode.

What is the difference between default and update?

default is the initial state, before tags fire. In regions that require prior consent it is often denied. update arrives when the person accepts or refuses in the CMP and replaces that state.

Why must default be set before tags fire?

Because a tag that fires before default can write cookies that conflict with the initial choice. Tags on the same event must read a single, consistent state. The order relative to the queue is that of the DataLayer.

How does GTM show the same update to every tag?

With the consent APIs and with the controls already present in native tag templates. The update is processed in the correct order relative to queued messages, not whenever it happens.

Effects of refusal, CMP and checks

What happens when storage is denied and how to read it in Tag Assistant. Product page: Consent Mode v2.

What happens if analytics_storage is denied?

Google Analytics 4 tags cannot read or write the analytics cookies used to recognize the user and the session. Cookieless pings may remain, depending on the Consent Mode configuration.

What happens if ad_storage, ad_user_data or ad_personalization are denied?

Advertising storage, the sending of user data for ads purposes, or personalization, including remarketing, is limited. Google Ads tags stay compliant with the choice. Modeling, where provided, is not the same as ignoring the refusal.

What is a CMP and how does it connect to the Tag Platform?

It is the system that collects and stores the choice. It integrates with GTM or gtag.js by emitting default and update, and optionally TCF v2.2. Without this bridge, the banner and the tags do not talk to each other: that is the problem Consent Mode v2 closes.

What problems come up with IAB TCF implementations?

Strings or purposes that are not aligned, a CMP that arrives after the tags, TCF support turned on only halfway in Google tags. Tag Assistant shows the state that was actually read, not the one the plugin promised.