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
15
votes
1 answer

dataLayer.push not working after GTM script

I want to implement the Enhanced Ecommerce with Google Tag Manager and I want to push some data for the tag Universal Analytics. I have always created the dataLayer before the GTM script, but now I need to send more data with dataLayer.push And it…
11
votes
6 answers

How to get values from dataLayer object

I want to get some values from dataLayer object of google tag manager. In chrome tag assistance i am getting values like this [ { "gtm.start": 1503053374849, "event": "gtm.js", "gtm.uniqueEventId": 0 }, { "event": "gtm.dom", …
Rakesh Sharma
  • 13,680
  • 5
  • 37
  • 44
9
votes
1 answer

GTM - pushing events/data to gtm dataLayer not sending anything to https://www.google-analytics.com/r/collect?v

I have added this gtm code in my chrome extension page(injected by the content script in and iframe) // (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var…
Aefits
  • 3,399
  • 6
  • 28
  • 46
8
votes
3 answers

How to update a dataLayer variable?

We initially push an object containing variables to the dataLayer: dataLayer.push({ 'environment': { 'userName': 'abc', 'id': 123, 'clicks': 0 } }); We now want to increase the value of environment.clicks with every…
7
votes
3 answers

Resetting Data Layer variables in Single page Applications ( Google Tag manager)

Trying to achieve content grouping in mobile site which is SPA. The scenario goes like this: When I am visiting a PDP page for the first time, category variable is set and this is sent to content groups in Universal Analytics Tag. If after this I go…
Pranay
  • 121
  • 1
  • 2
  • 7
5
votes
1 answer

Firefox Enhanced Privacy Protection is blocking Datalayer push to Google Tag Manager

Over the past few weeks I've realised that the conversion tracking in Google Analytics of a website we built and maintain has been off by about 20% - 40% each day. When testing in any browser but Firefox, everything works fine and you can see…
5
votes
0 answers

React JS + google tag manager: how to get data layer triggered on page transition

I received problems when trying to send data to GTM (google tag manager) in a React application. We already managed to put different scripts on the related page(s). For example below is one of script we put in cart page: class Cart extends…
Kris MP
  • 2,305
  • 6
  • 26
  • 38
5
votes
1 answer

Is there a safe way to use eventCallback with GTM DataLayer?

When somebody clicks the "buy" button on my website, I'm trying to track this event with Google Tag Manager using dataLayer and the dataLayer.push. There's what it looks like: dataLayer.push({ 'event': 'service', 'category': 'purchase', …
5
votes
1 answer

How to properly use dataLayer.push(), to update values, of nested objects, in an array?

Here is my dataLayer array: dataLayer = [{ 'giftBatch' : { 'giftID': '', 'giftAmount': 0, 'giftCount': 0, 'giftUpdate': { 'giftPhase': 'Gift Empty' } }, 'txBatch': { 'txID': '', 'txTotal': 0, 'txURL':…
4
votes
3 answers

Event listener for dataLayer push events on Tag Manager JS

I want to add a custom script that integrates into an existing Tag Manager dataLayer on a page. I need this script to be notified about new dataLayer pushes. So whenever something on the page uses window.dataLayer.push, my script should be informed…
topiji
  • 85
  • 1
  • 1
  • 7
4
votes
1 answer

error: package com.google.android.gms.tagmanager does not exist

I am working on a project in which i have used TagManager and Datalayer class for the implementation of GTA and enhanced ecommerce and i am using 'com.google.android.gms:play-services-base:12.0.1' in build.gradle and android studio version 3.0.1 is…
3
votes
1 answer

Custom DataLayer Code for WooCommerce | GA4

I hope all the experts are doing well. I am seeking a solution for my client's WordPress WooCommerce website, https://brille-klubben.dk. I need to track purchase events on the website. While I have tried several methods, I have been able to track…
3
votes
0 answers

Where can I push to the window.dataLayer in ReactJS

Assuming GTM is loaded and initialised, I want to use window.dataLayer.push() in ReactJS using the following code as soon as the page is loaded: window.dataLayer = window.dataLayer || []; window.dataLayer.push( { 'myvalue': value}…
quinny
  • 656
  • 1
  • 7
  • 24
3
votes
0 answers

google.maps.Data layer zIndex change is not reflecting on map

I am trying to add 2 google.maps.Data layers one has all the google.maps.Data.Feature of type Point and another is google.maps.Data.Feature of type Polygon. I want to see the polygon data layer in the front and point data layer at the back.So i am…
Manjunath M
  • 588
  • 1
  • 6
  • 30
3
votes
1 answer

How does the Firebase help on firing tags in google tag management

I am trying to understand what is the role of firebase to the google tag management. According to the GTM document Log events and variables, "your Firebase Analytics implementation acts as your data layer". And in the Fire tags section, the document…
1
2 3
22 23