Giter VIP home page Giter VIP logo

drupal-commerce-google-tag-manager's Introduction

Commerce Google Tag Manager Enhanced Ecommerce

@todo Update readme.

Provides Commerce integration for Enhanced Ecommerce via Google Tag Manager.

Test-CI Style-CI Downloads Releases
Build Status Code styles Downloads Latest Stable Version

Features

The module tracks the following Enhanced Ecommerce events:

  • Views of Product Details when viewing a commerce product entity.
  • Additions or Removals from cart
  • Checkout with the possibility to track checkout options
  • Purchases

All events are tracked server-side and stored in the session. The next "regular" page view loads all stored events via ajax and pushes them to Google Tag Manager via data layer.

The module offers a service to track other Enhanced Ecommerce events such as Product Impressions.

Configuration

The module does (currently) not offer any configuration options. The configuration is handled inside Google Analytics and Google Tag Manager.

Google Analytics

  • Enable Ecommerce and Enhanced Ecommerce Reporting in the settings of your property
  • Add labels for each checkout step under Checkout Labeling (optional)

Google Tag Manager

You need to create separate tags and triggers for each of the tracked Enhanced Ecommerce events.

First of all, create triggers of event type Custom Event with the following event names:

  • addToCart
  • removeFromCart
  • productDetailViews
  • checkout
  • purchase

Next, create tags for each trigger:

  • Set the tag type to Google Analytics - Universal Analytics
  • Set the track type to Event
  • Set the category to Ecommerce
  • Set the corresponding action, e.g. Add to Cart
  • Reference your Google Analytics settings. Important: The settings need the options Enable Enhanced Ecommerce Features and Use data layer to be activated. You can either create a new Google Analytics settings variable or override these options for the existing Google Analytics setting.
  • Select the correct trigger, e.g. addToCart

Testing and Debugging

  • Enable Preview in Google Tag Manager
  • In the same browser, navigate to the website and check that the debug window is displayed
  • Verify that the Enhanced Ecommerce tags are fired e.g. by visiting a product page, adding products to the cart or going through the checkout process.
  • Check the Ecommerce reports in Google Analytics.

Versions

Commerce Google Tag Manager is available for both Drupal 8 & Drupal 9 !

The version 8.x-1.x is not compatible with Drupal 8.8.x. Drupal 8.8.x brings some breaking change with tests and so you must upgrade to 8.x-2.x version of Commerce Google Tag Manager.

Which version should I use?

Drupal Core Commerce Google Tag Manager Drupal Commerce Drupal Google Tag
8.7.x 1.x 2.8 1.3
8.8.x 2.x 2.8 1.3
9.x 2.x 2.20 1.4

drupal-commerce-google-tag-manager's People

Contributors

wengerk avatar trent-crawford avatar wanze avatar didebru avatar mbovan avatar

Watchers

Christian Stocker avatar Lukas Kahwe Smith avatar James Cloos avatar Benjamin Wohlwend avatar

Forkers

didebru

drupal-commerce-google-tag-manager's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.