<img src="abc.png" />
    
call to replace anchor tags contains '/admin' in href

Google Tag Manager

Google Tag Manager(GTM) is a tag management system that allows you to quickly and easily update tags and code snippets on your website or mobile app, such as those intended for traffic analysis and marketing optimization. You can add and update AdWords, Google Analytics, Firebase Analytics, Floodlight, and 3rd party or custom tags from the Tag Manager user interface instead of editing site code. This reduces errors and frees you from having to involve a developer when configuring tags.

A tag is a snippet of code that sends information to a third party, such as Google. If you don't use a tag management solution such as Tag Manager, you need to add these snippets of code directly to files on your website or mobile app.


Setting up

  1. Go to tagmanager.google.com to create an account and click Sign up.

  2. The following window will appear to setup your account.

  3. Mention your account name and select the provided checkbox. Click Continue.

  4. Now create a container for your site in the account.

  5. Fill up the Container name and choose where to use the container. Click Create

  6. Click Yes on the pop up of Google Tag Manager Terms of Service Agreement.

  7. Now we have the code snippet of GTM.

  8. Copy the GTM id and click OK.


Configure GTM on StoreHippo

Follow these simple steps to configure Google Tag Manager on StoreHippo.


Verifying GTM

After you have configured your store on GTM, you can verify it that it is going well.
Go to Google Tag Manager and select your container name. The following window will appear:

You can add new tags by clicking on Add a new tag. A window will appear where you can add the tags by choosing from over 50 tag types.
For more information, refer Google Tag Manager overview.

FAQ

Q. How can be new GTM events added?

The new GTM events can be added in StoreHippo with the help of startup scripts. Startup scripts allow you to add behaviours like GTM events in StoreHippo. For example:

GTM adds an item when a product is added to cart

app.addPosthook({entity: "ms.carts", command: "addItem"}, function (req, res, next) {
    var product = res.data.product;
    window.dataLayer.push({
        'event': 'addToCart',
        'ecommerce': {
            'currencyCode': ms.user.currency.name,
            'add': {
                'products': [
                    {
                        'name': product.name,
                        'id': product._id,
                        'price': product.price,
                        'brand': product.brand,
                        'category': product.categories,
                        'variant': product.variant_id,
                        'quantity': product.quantity
                    }
                ]
            }
        }
    });
    next();
});
Q. What are GTM events that are supported by StoreHippo?

The GTM events supported currently by StoreHippo are:

  • Product Impressions
  • Product Clicks
  • Product Detail Impressions
  • Add / Remove from Cart
  • Checkout
  • Purchases