DataLayer Inspector

DataLayer Inspector

Paste your dataLayer array and instantly analyze events, parameters, and potential issues

Copy JSON.stringify(dataLayer) from your browser console and paste it below.

Inspection Results

How to Capture Your DataLayer

Open your browser’s Developer Tools (F12), go to the Console tab, and run one of these snippets:

📋 Quick Copy (JSON)

copy(JSON.stringify(dataLayer, null, 2))

Copies the entire dataLayer to your clipboard as formatted JSON. Paste it directly into the inspector above.

📊 Live Monitor (Console Table)

// Monitor dataLayer pushes in real-time
(function(){
  var orig = dataLayer.push;
  dataLayer.push = function(){
    var args = Array.prototype.slice.call(arguments);
    args.forEach(function(obj){
      console.group('%c dataLayer.push ', 'background:#1e3a5f;color:#fff;padding:2px 6px;border-radius:3px');
      if(obj.event) console.log('%cEvent: ' + obj.event, 'color:#10b981;font-weight:bold');
      console.table(obj);
      console.groupEnd();
    });
    return orig.apply(dataLayer, arguments);
  };
  console.log('%c DataLayer Monitor Active ', 'background:#10b981;color:#fff;padding:4px 8px;border-radius:4px;font-size:14px');
})();

Intercepts all future dataLayer.push() calls and logs them as formatted console tables. Great for debugging event firing in real-time.

Common DataLayer Issues

Missing Event Key

Every dataLayer push should have an event key to trigger GTM tags. Pushes without it only set variables — they won’t fire tags.

🔠

Inconsistent Naming

Mixing camelCase and snake_case (e.g., pageView vs page_view) creates duplicate events in GA4. Pick one convention and stick to it.

🔎

Nested Ecommerce

GA4 ecommerce events require items inside an ecommerce.items array. Each item needs at minimum item_id or item_name.

🔒

PII in DataLayer

Never push email addresses, phone numbers, or user IDs that could identify individuals. Use hashed values or internal IDs instead.

Frequently Asked Questions

The dataLayer is a JavaScript array that acts as a communication layer between your website and Google Tag Manager. When you push objects into it, GTM can read the data and use it to fire tags, set variables, and send events to analytics platforms like GA4.

GTM processes dataLayer pushes sequentially. If you push an event before the required variables are set, the tag may fire with missing data. Always push variables before the event that needs them, or include everything in a single push object.

Verify that: (1) all required events fire at the right time, (2) event names match your measurement plan, (3) ecommerce items have required fields, (4) no PII is being pushed, (5) values have correct data types (numbers vs strings), and (6) events don’t fire duplicate times.

This inspector is designed for the Google Tag Manager dataLayer format, but the analysis applies to any system using a similar JavaScript array pattern. The ecommerce checks are specific to GA4’s enhanced ecommerce schema.

No. All parsing and analysis runs entirely in your browser. Your dataLayer contents never leave your device.