Google Tag Manager

Website using GTM can install Frenzy GTM custom template to send the events direct to Frenzy. This page explains how to install and configure the template.

Installing GTM template

  1. Go to the 'Tag Templates' section and click on the 'New' button.

2. Import the GTM template file shared by Frenzy.

3. Save the Imported Template.

4. Once the template has been saved, the installation is complete. You will be able to see the Installed template listed in the 'Tag Templates' section.

Configuring the template

The template provides six fields, to send the necessary information to the Frenzy.

Field Name
Explanation

API Endpoint

API url provided at the time of account creation.

API Key

API key provided at the time of account creation.

Method

The type of event to share e.g. Add to Cart, etc.

User ID

User ID that triggered the event.

Query ID

Query ID sent in the response of search, recommendation, etc calls. (this field can be ignored).

SKU

Affected SKU.

Variables

Fields like- User ID, Query ID, and SKU depend on the user click and should be created as 'User-Defined Variables' in GTM. The values of these variables will used to populate the respective fields and will be sent to Frenzy.

Sending Variable Data

Variable data will be sent to the Data Layer on your website. GTM will read the values from the Data Layer. Add information to the Data Layer using dataLayer.push command. For more details.

<a href="#" onclick="dataLayer.push({
    'user_id': '123',
    'sku': 'PSS-100-1000'
});">Add to Cart</a>

Creating Variables

For sending the events to Frenzy, follow these steps to create data layer, user defined variables.

  1. Click on the 'New' button on the 'User-Defined Variables' section.

2. Select the 'Data Layer Variable' option.

3. Give variable a name. Here the data layer variable name is 'sku' and GTM variable name is 'productSKU'. Once the varibale is created click on the 'Save' button. NOTE: The data layer variable name must match the key being sent to the data layer on the webpage frontend.

4. Follow the same process to create a variable for 'user_id'.

Triggers

Create a trigger for each type of event. Example- create a trigger to send the 'add to cart' events.

  1. Click on the 'New' button in 'Triggers' section.

2. Create a click based trigger.

Triggers depend on the DOM of your webpage. In this example the tigger is executed for all clicks with 'Add to Cart' text. Once the tigger has been created click on the 'Save' button.

<div>
    ...
    <button type="button">Add to Cart</button>
    ...
</div>

3. Follow the same steps to create other triggers.

Tags

Tags specify the event type/method executed by the user.

  1. Click on the 'New' button in the 'Tags' section.

2. Click on the 'Tag Configuration' and then select the 'Frenzy Events' from the 'Custom' section.

3. Fill the tag and the trigger with the required values.

  • Enter the 'API Endpoint' and 'API Key' values provided at the time of account creation.

  • Because this example sends 'Add to cart' events, select the required option from the 'Method' dropdown.

  • Enter the variable names for 'User ID', 'Query ID' and 'SKU' fields.

  • Click on the Trigger button and select the 'Add to Cart Trigger' created earlier.

  • Click on the 'Save' button once all the changes have been made.

4. Follow the same procedure for sending other events.

5. Once Tag is ready, contact Frenzy team to ensure that events are being sent properly.

Last updated

Was this helpful?