How to add Google Tag Manager code snippets to the store pages
page last edited on 29 March 2017
Google Tag Manager is a tag management system that allows you to quickly and easily update tags and code snippets on a website, such as those intended for traffic analysis and marketing optimization.
To use the Google Tag Manager solution with X-Cart, you need to set up a tag container in your Google Tag Manager account and add the container code snippets to every page of your X-Cart based store.
This article provides instructions for how to add the Google Tag Manager container snippets to your store’s pages.
Follow the steps below:
Make sure the module Theme Tweaker is enabled in your X-Cart store. By inserting the Google Tag Manager code snippets into your store’s pages, you are going to modify templates. Theme Tweaker is needed so these template modifications are handled as a separate module, which, in the long run, ensures hassle-free X-Cart upgrades.
Activate Webmaster mode.
/skins/theme_tweaker/customer/header/body.twig using Webmaster mode.
Similarly, copy the
<noscript>portion of the Google Tag Manager snippet and paste it using Webmaster mode into the file
Apply the changes you have made in Webmaster mode.
Disable Webmaster mode. After that, Theme Tweaker will create a new module containing copies of the above named X-Cart templates modified by adding the Google Tag Manager code snippets.