HCL Commerce Version 9.1.4.0 or later

Setting up Google Tag Manager for Universal Analytics

Google Tag Manager manages all your website tags. To integrate HCL Commerce with Google Analytics, you must add tags for each store in the Google Tag Manager.

Google Tag Manager acts as a bridge between the React Store and Google Analytics.

  • Each property that you define in Google Analytics maps to one Container in Google Tag Manager.
  • Each React Store has a corresponding Container defined in Google Tag Manager.
  • Each Container provides the following parameters that the React Store uses:
    • gtmid
    • gtm_auth
    • gtm_preview

Prerequisites

You must have a Google Tag Manager account.

Importing parameters for the Reference Store applications

The Reference Store application Google Tag Manager templates contain all the tags, triggers, and variables for the B2B and B2C Reference Store applications.

Complete the following steps to download the template and import it into Google Tag Manager.
  1. HCL Commerce Version 9.1.4.0 or laterIf you are using version 9.1.4 or version 9.1.5, download ReactReferenceApp_GTM_config.json.
  2. HCL Commerce Version 9.1.6.0 or laterIf you are using version 9.1.6, download IMPORT-GTM-CONTAINER_EmeraldWorkspace.json and IMPORT-GTM-CONTAINER_SapphireWorkspace.json.
  3. HCL Commerce Version 9.1.12.0 or laterFrom version 9.1.12 onwards, download IMPORT-GTM-CONTAINER_Emerald and EmeraldMP Workspace and IMPORT-GTM-CONTAINER_Sapphire and SapphireMP Workspace.
  4. HCL Commerce Version 9.1.13.0 or laterFrom version 9.1.13 onwards, download IMPORT-GTM-CONTAINER_Emerald and EmeraldMP Workspace and IMPORT-GTM-CONTAINER_Sapphire and SapphireMP Workspace.
  5. HCL Commerce Version 9.1.14.0 or laterFrom version 9.1.14 onwards:
  6. Log into Google Tag Manager and go to the container for the Emerald Reference Store application.
  7. Go to the Admin tab and click Import Container.
  8. Upload the template json files into the container. Select Existing workspace > Default workspace and select the Merge option with Overwrite conflicting tags, triggers and variables.
  9. Go to the Workspace tab > Variables.
  10. Find Tracking ID and update with the actual Google Analytics Tracking ID (For example, UA-247689403-2).
  11. Click Submit and then Publish to deploy this configuration on Google Tag Manager.