Frenzy AI Personalization
  • Welcome to the Frenzy docs
  • Shopify App
    • Product Feed Sync
    • Install Components
    • Configuring Product Card
      • Custom Data
      • Reviews
      • Wishlist Icons
      • Quick Views
      • Swatches
      • Testing Product Cards
    • Search & Collections
      • Merchandising
        • Sorting
        • Rules
      • Filters
        • Filter Trees
    • Recommendation Widgets
      • Widgets
      • Data Sources
    • Synonyms
    • Global CSS
    • Tutorials
      • Search & Collection Page Merchandising
        • How to Bury Products Globally on all Collection Pages
        • How to Pin Products in Collection Group
        • How to Bury Sale Products Globally on all Collection Pages
        • How to Sort a Collection Page based on Newly Published/Created Products
        • How to Bury Sale Products Globally on all Search Pages
        • How to Hide Products on Search Pages Globally
        • How to boost products (using tags) for a Search Query
        • How to turn on Personalization on Collection Groups
        • How to show Shopify Merchandising on Collection Groups
        • How to bury Out Of Stock Products in Collection Groups
        • How to turn on Personalization on All Search Result Pages
        • How to setup top 10 automated Bestsellers Collections
        • How to Group Products using Tags on Collection Pages
        • How to setup custom products groups on Collection Pages
        • How to Group Products using Tags on Search Pages
        • How to set-up an A/B test on Search and Collection pages
      • Recommendation Carousels
        • How to change the title of the Carousel
        • How to set up an A/B test on a recommendation carousel
        • How to add a collection based homepage carousel
        • How to add 'Selected for You' homepage carousel
        • How to add 'Best Sellers' homepage carousel
        • How to Hide Products in Recommendation Carousels
        • How to create Manual Product Based Carousel
      • Filters
        • How to create filters from Product Tags
        • How to create filters from Product Metafields
        • How to create filters from Color Variants
      • Synonyms
      • Swatches
  • API Functions
    • Search
      • Search API Call
      • Suggest API Call
    • Carousels
      • /recommendation
      • /pair-with
      • /personalized-recommendation
      • /most-clicked-skus
      • /add-cart
    • Sharing Event Data
      • Google Tag Manager
      • API Call
    • product-data
  • Support
Powered by GitBook
On this page
  • Installing GTM template
  • Configuring the template
  • Variables
  • Triggers
  • Tags

Was this helpful?

  1. API Functions
  2. Sharing Event Data

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.

PreviousSharing Event DataNextAPI Call

Last updated 3 years ago

Was this helpful?

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

<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.

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