/eec-gtm

DOM scraping scripts for tracking content with Enhanced Ecommerce with Google Tag Manager

Primary LanguageJavaScript

eec-gtm

DOM scraping scripts for tracking content with Enhanced Ecommerce with Google Tag Manager.

Tags

Custom HTML

These can be found in the tags folder of this repository. Remember to modify them so that they match your content. EEC - HTML - Compile impressions * Trigger 1: DOM Ready * Trigger 2: EEC - Impression click

EEC - HTML - Checkout Funnel and scroll tracking

  • Trigger: EEC - Page is an article

Universal Analytics

EEC - Event - Add To Cart * Tag Type: Event * Event Category: Ecommerce * Event Action: Add To Cart * Enable Enhanced Ecommerce Features: Checked * Use data layer: Checked * Trigger: EEC - addToCart

EEC - Event - Checkout

  • Tag Type: Event
  • Event Category: Ecommerce
  • Event Action: Checkout
  • Enable Enhanced Ecommerce Features: Checked
  • Use data layer: Checked
  • Trigger: EEC - checkout

EEC - Event - Product Click

  • Tag Type: Event
  • Event Category: Ecommerce
  • Event Action: Product Click
  • Enable Enhanced Ecommerce Features: Checked
  • Use data layer: Checked
  • Trigger: EEC - productClick

EEC - Event - Product Detail Impression

  • Tag Type: Event
  • Event Category: Ecommerce
  • Event Action: Product Detail Impression
  • Non-Interaction: True
  • Enable Enhanced Ecommerce Feature: Checked
  • Use data layer: Checked
  • Trigger: EEC - productDetail

EEC - Event - Product Impressions

  • Tag Type: Event
  • Event Category: Ecommerce
  • Event Action: Product Impressions
  • Non-Interaction: True
  • Enable Enhanced Ecommerce Feature: Checked
  • Use data layer: Checked
  • Trigger: EEC - impressionsPushed

EEC - Event - Purchase

  • Tag Type: Event
  • Event Category: Ecommerce
  • Event Action: Purchase
  • Enable Enhanced Ecommerce Feature: Checked
  • Use data layer: Checked
  • Trigger: EEC - purchase

Variables

Custom JavaScript

These can be found in the variables folder of this repository. Remember to modify them, so they work on your site!

EEC - Impression click TRUE

EEC - Words in text price

Data Layer

EEC - Post type * This variable should return the post type of the page * This is used in the trigger for the Checkout plugin, since it should only fire if the page is an article page

Triggers

Custom Event

EEC - checkout * Event name to match: checkout * All Events

EEC - impressionsPushed

  • Event name to match: impressionsPushed
  • All Events

EEC - productClick

  • Event name to match: productClick
  • All Events

EEC - productDetail

  • Event name to match: productDetail
  • All Events

EEC - purchase

  • Event name to match: purchase
  • All Events

EEC - addToCart

  • Event name to match: addToCart
  • All Events

Page View

EEC - Page is an article

  • Filter 1: {{EEC - Post type}} equals single-post
  • Trigger Type: DOM Ready

Link Click

EEC - Impression click

  • Tag filter: {{EEC - Impression click TRUE}} equals true
  • Listener filter: {{Page URL}} matches RegEx .*