Google Tag Manager

Reference

This document contains reference material for Google Tag Manager.

  1. API Reference
  2. Ecommerce Data Layer Variable Names
  3. Social Data Layer Variable Names

API Reference

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 object needs to be initialized.

Example:

  <script>
  dataLayer = [{
    'pageCategory': 'signup',
    'visitorType': 'high-value'
  }];
  </script>
  

dataLayer.push

A method to update the data layer with new or updated key/value pairs.

Example:

  <script>
    dataLayer.push({'pageCategory': 'updated value'});
  </script>
  

Ecommerce Data Layer Variable Names

You must use required Ecommerce data layer variable names in order to use Google Analytics or Universal Analytics transaction tags. Not using these variable names can result in lost or incomplete Ecommerce data in your Google Analytics reports.

Social Data Layer Variable Names

The following variable names are required if you are using Google Analytics social tracking tags and have checked the Use Data Layer option in the tag edit view:

Data Layer Variable Name Description
network Required. A string representing the social network being tracked (e.g. Facebook, Twitter, LinkedIn)
socialAction Required. A string representing the social action being tracked (e.g. Like, Share, Tweet)
opt_target Optional. A string representing the URL (or resource) which receives the action.
opt_pagePath Optional. A string representing the page by path (including parameters) from which the action occurred.

Learn more about social interaction tracking.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.