Creating a Convert Goal from a GTM Data Layer event

THIS ARTICLE WILL HELP YOU:

Issue Explanation

Sometimes we may have already tracked conversions through GTM using dataLayer events, and we would like to use these conversion events to create conversion goals in Convert.

Instructions

We can do this by implementing a GTM tag with a Convert JavaScript Triggered Goal code that would be used to trigger the GTM dataLayer event that we want to track.

First, let say that an event called TestAction is being pushed into the dataLayer in the following way:

window.dataLayer = window.dataLayer || []
window.dataLayer.push({
event: 'TestAction'
});

  1. Create the Convert Javascript Triggered Goal:

    Open your experiment on the Experience Summary and click on the Goal Editor to open it. Access the Goal Templates:




    Select the JavaScript Triggered Goal Template:



    Name your new goal and save it. Open your newly-created goal. Select and copy the JavaScript code from the goal and paste it somewhere to later create your GTM Tag.



  2. Go to your Google Tag Manager account at https://tagmanager.google.com/ and select the account you are going to work on.

    Click on the "ADD A NEW TAG" button:





    Click on the "Choose a tag type to begin setup":




    Scroll down and select the "Custom HTML" option.




    Paste the code from the Convert JavaScript Triggered Goal into the HTML Section and name your tag:




    When the following dialog opens, select the "ADD TRIGGER" option:




    A list of possible triggers should appear.  Click on the "+" icon on the upper left, and select the trigger type:




    Scroll down and select the "Custom Event" option:




    Re-save your whole Tag, and you are done.

  3. Test your goal by triggering the GTM dataLayer event, and see if the goal is triggered in your experiment. You can also access Goals by clicking on Goals in the top tab next to Experiences.