Questions tagged [google-datalayer]

The dataLayer is a global object of key/value pairs passed to Google Tag Manager. It can be used to describe information that isn't available as part of a page DOM or other JavaScript variables.

The dataLayer is a global object of key/value pairs passed to Google Tag Manager. It can be used to describe information that isn't available as part of a page DOM or other JavaScript variables.

338 questions
3
votes
1 answer

Parsing eCommerse data to push into dataLayer for Google Tag Manager

Below is the eCommerse data pushed into the ether. I want to extract specific bits of the data to push it to Google Tag Manager's (GTM) dataLayer array. Anything hidden, I have no use for (e.g. Credit Card info and etc.). Please note that all of…
3
votes
1 answer

GTM - return Enhanced Ecommerce object in variable/macro

Situation Enhanced Ecommerce tracking is fully implemented on some website. This is done by build-in feature Enhanced Ecommerce - use dataLayer. Example: var ecommercObject = { 'ecommerce': { 'purchase': { 'actionField': { …
3
votes
1 answer

Google Tag manager not registering Transactions for enhanced Ecommerce

I am running a single page checkout and the pagevies are showing fine. however the purchase transactions doesn't seem to be being processed in Google analytics. I have the data layer up and it seems to be registering the purchase event, I have…
UKDataGeek
  • 6,338
  • 9
  • 46
  • 63
3
votes
0 answers

GTM - How to configure checkout steps and transaction

Let me start off by saying that previously the GTM on the site worked well. One thing I am struggling with now is setting up checkout steps and having GTM still pick up all the transaction data. Previously I had GTM and the data layer like this at…
3
votes
1 answer

Google Tag Manager event tracking for dom elements

with Google Tag Manager Auto-Event Tracking (dataLayer.push), I want to track this information: the name of the links clicked in my menu, for example:
2
votes
1 answer

How to add datalayer.push on WordPress functions.php?

I want to add datalayer.push on WordPress functions.php, I tried the following code but it throws an error, Uncaught Error: Call to a member function get_id() on string... add_action('wp_head', 'datalayer_push'); function datalayer_push($product) { …
2
votes
1 answer

Transform Google Analytics 4 datalayer to braze purchase

I would like to use our GA4 (Google Analytics 4) purchase datalayer to send those information to our customer engagement tool braze. I am not sure how to loop through the GA4 items and pass them to braze. Any help is highly appreciated! The GA4…
marius
  • 31
  • 2
2
votes
1 answer

Google Tag Manager - custom javascript to extract dataLayer variable

Firstly, apologies for the lack of technical know-how... I have a datalayer variable in google tag manager which I want to extract information from using custom javascript but I'm not the most technical. From the picture attached, I want to extract…
MoHawk
  • 63
  • 1
  • 6
2
votes
1 answer

Why do I have to trigger a click event twice to get the proper dataLayer to fire?

Context I am attempting to push events to the data layer on a Shopify site. I'm utilizing a liquid file that combines liquid and JS code to extract appropriate data from the site to push to the data layer. All of the events are firing properly with…
dentalhero
  • 689
  • 3
  • 10
  • 30
2
votes
1 answer

Can I push a datalayer when a product is added to the cart

I have created a custom event and created a datalayer push into the template.liquid-file in my Shopify. I can get my custom event to fire in Tag Manager when I just view a product, so I know that the push works, but I need to trigger the push when a…
2
votes
1 answer

DataLayer with python

is it possible to extract value from data layer? This is url =…
2
votes
2 answers

Access Google Tag Manager dataLayer field values on gtm.formsubmit

I am trying to pick up the selected value for a drop down field on a form when the form is submitted. Through the developer console in Chrome, I can see the value I want in the GTM dataLayer. It is inside the gtm.element[1] in the…
analyticsPierce
  • 2,979
  • 9
  • 57
  • 81
2
votes
1 answer

window.dataLayer.push is working in local machine but not in the production environment

This is the logout logic, here the key logoutoverlay, is set in the local storage.
{ localStorage.removeItem("manage"); …
2
votes
1 answer

How to add GTM in nextJS typescript (window.dataLayer is not a function)

I am implementing GTM on my website, but my NextJS project is in Typescript. I used the example of Github the example of Github, but this error appears: TypeError: window.dataLayer is not a function This is my gtm.js file: export const GTM_ID =…
Luck dev
  • 435
  • 2
  • 5
  • 13
2
votes
0 answers

Google tag manager variable for checked radio button does is always undefined

I have created a landing page which has one form (being used twice) where the user inputs his email and choses a value from three radio buttons. I am trying through Google Tag Manager to trigger a custom event when upon successful submission (both…
1
2
3
22 23