How-To Guide: Tracking On-site Promotions with GTM

  • How-To Guide: Tracking On-site Promotions with GTM

How-To Guide: Tracking On-site Promotions with GTM

Attracting the right visitors to your website and encouraging them to accomplish a desired outcome can often feel like laying out a trail of breadcrumbs for them to follow.

In-Store PromotionsThe trail may start from a post on Facebook, a Google search ad, or an email newsletter, from which the person arrives to your website. You may then lay out some hero images, featured posts, or sidebar links to lead them deeper into your site. And finally, you may encourage the visitor to submit a form, download a brochure, or make a purchase.

When it comes to analyzing this customer journey and optimizing your marketing activities, you’ll want to ensure that you can track every step; every breadcrumb in the trail. In fact you’ll want to track every trail, as there are likely many paths each visitor could follow to the same destination.

If you have Google Analytics, you are likely familiar with using “utm” parameters to track inbound campaigns and Goals to track key outcomes. But what do you use to track the path of visitors through your site on the way to completing those outcomes?

You may know that 5% of visitors from LinkedIn downloaded your whitepaper, but how many of them got there by clicking the hero image vs. the link in the sidebar?

The rest of this post is a how-to guide on setting up internal promotion tracking in GA through Google Tag Manager. With a little bit of effort, you too can measure the effectiveness of your on-site promotions!

Prior to the introduction of Internal Promotion tracking in GA, tracking on-site campaigns was often done in one of the following ways:

  • Leveraging the Site Search reports. For example, see this post by Justin Cutroni.
  • Tracking events for clicks on promotional links.
  • Adding custom query parameters to promotional links.

Although these methods provide information on how frequently your internal promotions are being clicked, it is challenging to see how each promotion is contributing to a certain goal conversion.

Internal Promotion tracking is part of Enhanced Ecommerce features in Universal Analytics. But it’s certainly not just for ecommerce sites! You can enable Enhanced Ecommerce and use the Internal Promotion reports even if you are not tracking ecommerce transactions in GA.

How to Implement Internal Promotion Tracking

1. Enable Enhanced Ecommerce in Google Analytics

  1. In your GA admin panel, select the desired view and click on Ecommerce Settings
  2. Switch on Enable Ecommerce (if not already enabled)
  3. Switch on Enhanced Enhanced Ecommerce Reporting

Remember, you do not need to sell anything online in order to enable this. If you are using Ecommerce tracking in GA already, but not Enhanced E-commerce, you should be able enable Enhanced Ecommerce without any impact on your tracking, but we recommend first testing in a separate view.

With respect to internal promotion tracking, enabling Enhanced Ecommerce gives you access to four built-in dimensions to capture information about your promotionscc_intpromo_05:

  1. Name: e.g. Summer Sale
  2. ID: e.g. PROMO_1234
  3. Position: e.g. banner_slot_1
  4. Creative: e.g. summer_banner_2

(Note that either Name or ID field is required with other fields being optional)

Enhanced Ecommerce also provides a pre-built Internal Promotions report. Once enabled, you will find it under the Conversions section in GA.

Once you start collecting data on impressions and clicks of your internal promotions, your report will look something like this:

Internal Promotions Report Example

GA automatically calculates a click-through rate (CTR) for each promotion and shows you conversions that occurred as a result. Just like other standard GA reports, you can switch the primary dimension, add a secondary dimension, and view different conversion metrics.

Now that we have an idea of what this should look like once we are done, let’s send information about our promotions to GA.

2. Tag Internal Promotion Links

To identify and label our internal promotions, you can use custom URL query parameters. This is often the easiest way of adding information into promotional links that are managed through a CMS. It also provides an efficient transition in the case you are already tracking internal promotions through URL parameters (e.g. using site search).

We will use four URL query parameters:

  • promo_name
  • promo_id
  • promo_creative
  • promo_position

(Note: If you already have your own custom parameters in your promo links, you can use those instead.)

These parameters should be added to all promotional links that we wish to track. Note that only one of promo_name or promo_id is required; the other parameters are optional.

For example, if we have a promotion for a “Spring Sale” located in our top banner, the link may look like this:

<a href="http://www.mydomain.com/spring_promo?promo_name=Spring_Sale&promo_id=1604001&promo_creative=v1&promo_position=Top_Banner">Spring Sale</a>

Note that there are other methods for making promotion information available (e.g. HTML attributes, data layer). As long as the information is available on the page, you can configure GTM to capture it and send it to GA with your promotion impressions and clicks.

3. Configure Tracking in Google Tag Manager

Once all of that is done, we will configure GTM to pick up this information and send it to GA. We need to set up a total of 4 variables, 5 triggers and 3 tags for this.

First, we need to create our variables:

  1. Create “Promo Name” variable:
    • Create new Auto-Event Variable
    • Set Variable Type to Element URL
    • Set Component Type to Query
    • Enter promo_name in the Query Key
      Promo Name Variable
  2. Next we will create 3 variables that have similar configuration with the only difference in “Query Key” parameter:
    • Promo ID with Query Key set to promo_id
    • Promo Creative with Query Key set to promo_creative
    • Promo Position with Query Key set to promo_position

Next, create our triggers:

  1. “DOM Ready” Trigger. (Check first to see if you already have a DOM Ready trigger configured):
    • Create new Page View – DOM Ready trigger.
    • Fire on All DOM Ready Events.DOM Ready Trigger
  2. “Click – Promo Click – ID found”:
    • Create new Click trigger for Just Links.
    • Fire on {{Promo ID}} matches RegEx (ignore case) .+Click - Promo Click - ID found trigger
  3. “Click – Promo Click – Name found”:
    • Create new Click trigger for Just Links.
    • Fire on {{Promo Name}} matches RegEx (ignore case) .+Click - Promo Click - Name found trigger
  4. “Internal Promotions View” trigger:
    • Create new Custom Event trigger.
    • Set the event name to promotionView
    • Set trigger to fire on all custom events.Event - Internal Promotions View trigger
  5. “Internal Promotion Click” trigger:
    • Create new Custom Event trigger.
    • Set the event name to promotionClick 
    • Set trigger to fire on all custom events.Event - Internal Promotion Click trigger

Finally we will set up our tags:

  1. Custom HTML tag to track promotion views. This tag should fire on the “DOM Ready” trigger and it will contain the following code:
    <script type="text/javascript">
    (function () {
     "use strict";
     var internalPromotions = {
     promos: [],
     count: 0
     };
     var promo_name='promo_name';//change to your query parameter if needed
     var promo_id='promo_id';//change to your query parameter if needed
     var promo_creative='promo_creative';//change to your query parameter if needed
     var promo_position='promo_position';//change to your query parameter if needed
    
     function getParameterByName(name, url) {
     var regex = new RegExp("[?&]" + name.replace(/[\[\]]/ig, "\\$&") + "(=([^&#]*)|&|#|$)");
     var results = regex.exec(url);
     if (!results) return null;
     if (!results[2]) return null;
     return decodeURIComponent(results[2].replace(/\+/ig, " "));
     }
    
     Array.prototype.slice.call(document.getElementsByTagName("a")).forEach(function (element) {
     if (element.getAttribute("href") !== null && element.getAttribute("href") !== undefined) {
     if (element.getAttribute("href").match(new RegExp(promo_name, 'ig')) !== null || element.getAttribute("href").match(new RegExp(promo_id, 'ig')) !== null) {
     internalPromotions.promos[internalPromotions.count]={};
     if (element.getAttribute("href").match(new RegExp(promo_name, 'ig')) !== null){
     internalPromotions.promos[internalPromotions.count].name = getParameterByName(promo_name, element.getAttribute("href"));
     console.log(element.getAttribute("href").match(new RegExp(promo_name, 'ig')));
     }
     if (element.getAttribute("href").match(new RegExp(promo_id, 'ig')) !== null){
     internalPromotions.promos[internalPromotions.count].id=getParameterByName(promo_id, element.getAttribute("href"));
     }
     if (element.getAttribute("href").match(new RegExp(promo_position, 'ig')) !== null){
     internalPromotions.promos[internalPromotions.count].position=getParameterByName(promo_position, element.getAttribute("href"));
     }
     if (element.getAttribute("href").match(new RegExp(promo_creative, 'ig')) !== null){
     internalPromotions.promos[internalPromotions.count].creative=getParameterByName(promo_creative, element.getAttribute("href"));
     }
     internalPromotions.count+=1;
     }
     }
     });
    
     if (internalPromotions.count > 0) {
     dataLayer.push({
     'event': 'promotionView',
     'ecommerce': {
     'promoView': {
     'promotions': internalPromotions.promos
     }
     }
     });
     }
    
    }());
    </script>
  2. Custom HTML tag that will track promotion clicks. This tag should fire on the “Click – Promo Click – ID found” and “Click – Promo Click – Name found” triggers and it will contain the following code:
    <script type="text/javascript">
    (function() {
     "use strict";
     var promo_name = {{Promo Name}};
     var promo_id = {{Promo ID}};
     var promo_creative={{Promo Creative}};
     var promo_position={{Promo Position}};
     var promoClickData = {};
     if ((promo_name !== undefined && promo_name.length > 0) || (promo_id !== undefined && promo_id.length > 0)) {
     if (promo_name !== undefined && promo_name.length > 0) {
     promoClickData.name = promo_name;
     }
     if (promo_id !== undefined && promo_id.length > 0) {
     promoClickData.id = promo_id;
     }
     if (promo_creative !== undefined && promo_creative.length > 0) {
     promoClickData.creative = promo_creative;
     }
     if (promo_position !== undefined && promo_position.length > 0) {
     promoClickData.position = promo_position;
     }
     dataLayer.push({
     'event': 'promotionClick',
     'ecommerce': {
     'promoClick': {
     'promotions': [promoClickData]
     }
     }
     });
     }
    
    }());
    </script>
  3. Finally, we will set up a separate GA Tag to track promotion impressions and clicks. It will have the following configuration and will load on both Internal Promotions triggers we created:

GA Tag to track impressions and clicks

Test, publish and you are done!

Let us know if you have any questions, comments, or suggestions about tracking internal promotions in Google Analytics

By |2019-08-23T12:56:03-04:00April 27th, 2016|42 Comments

42 Comments

  1. reinier November 2, 2016 at 6:42 am - Reply

    We have a slider, but even the promotions we don’t see are coming in as viewed. How can we solve this problem?

    • Max Bondarenko November 7, 2016 at 10:07 am - Reply

      Hi Reiner,

      The script provided assumes all promotions are visible on the page. You would need to modify it to ensure that only visible promotions are sent. Perhaps you can use ideas that are used in ReadJS plugin. We are working on a new script that takes visibility into account but could not give you an indication on when that would be released to the public.

  2. Suzanne Karzoun December 21, 2016 at 5:10 pm - Reply

    I was wondering if there was a solution to the visibility of the promotions issue yet. I am having the same problem with our drop-down menus.

    • Max Bondarenko December 23, 2016 at 8:28 am - Reply

      Hello Suzanne,

      We are still deciding on wherever to release this kind of tracking to general public, given how much work we put into it.

  3. Terry March 7, 2017 at 7:25 am - Reply

    Hi. Wondering if there has been an update to this process / code based no the update to tag manager and if the visibility issue has been resolved here. We regularly put promotions in sliders so I’d like to know that they are tracked properly when clicked.

    • Max Bondarenko March 9, 2017 at 10:17 am - Reply

      Hi Terry,

      Outside of minor interface changes in GTM, I believe that the process of adding internal promotion tracking remains the same. Do let me know if there is specific issue that I might have overlooked.

      In terms of the scripts – they still work for both clicks and impressions. The only difference in this case is that impressions are sent for all promotions on the page without regards for their visibility (this would inflate the number of actual impressions). Clicks, on the other hand, should be tracked as expected – they are sent only when person clicks on a promotion. If you do notice any specific issues with this scripts – do let me know and I will try to address them.

      In regards to promotion visibility – while we do have an updated version of the script that tracks which exact pieces of content were visible and sends impressions only for those elements – we will not be releasing that script to public as it involved significant time investment on our side.

  4. Ajay March 16, 2017 at 4:01 am - Reply

    Hi…
    How can i track banner impression of publisher in GA with GTM with above tricks

    • Max Bondarenko March 16, 2017 at 7:05 am - Reply

      Hi Ajay,

      Just to clarify – is this for banner impressions on your site or on 3rd party(publisher’s) site? You can only track impressions on the site that you control or can install GTM code on.

  5. Josef Hilbert April 2, 2017 at 2:48 pm - Reply

    Hi, great post, I got 2 questions:
    1) eventCallBack
    The Custom HTML to track promotion clicks does not use the eventCallBack data layer variable as described in the sample code provided by google here … https://developers.google.com/tag-manager/enhanced-ecommerce#promo-clicks
    Was this done on purpose? In case you recommend to use the eventCallBack, shouldn’t we also consider Simo’s tip and use the eventTimeout as well?

    2) Tag Sequence
    Wouldn’t it be necessary to define a tag sequence so that the tag to track promotion impressions and clicks fires after the Custom HTML tags?

    Thanks!
    Josef

    • Max Bondarenko April 3, 2017 at 8:04 am - Reply

      Hello Joseph,
      1) Our code is not blocking navigation nor the instructions above suggest using “Wait for tags” option in click triggers, so there is no need to add eventCallBack to dataLayer.push inside the code. However, if you modify the code above to block navigation (perhaps to make sure you capture all the clicks possible) until data is sent to GA do ensure to include both eventCallBack and eventTimeout.
      2) In terms of tag sequencing, it might not be the best way to do this as this may cause the tracking script to load several times and create conflicts/send duplicate data. The setup in the instructions loads the script that checks the page for impressions and then sends data to Data Layer if anything is found and triggers GTM event at the time, based on that fact we then send impression data to GA(using Internal Promotions View trigger). Our click tracking works in the similar way so there is no need for sequencing. You can potentially optimize the click trigger by moving logic from HTML tag for click tracking into a custom JS variable and then using it in your click trigger(thus removing extra step).

  6. Sam April 20, 2017 at 2:52 pm - Reply

    Hi,

    The issue I see at the moment with this, is that if no promotion is clicked on, Google will credit Transactions to the last ‘viewed’ promotion.

    However, if we are tagging a bunch of elements on our homepage as internal promotions, this attribution method will ruin transactional data – we definitely want this, as CTR could be misleading, versus whether the promo/site element really does lead to more orders. Any way around this??

    • Marc Soares April 25, 2017 at 11:11 am - Reply

      Hi Sam,

      It sounds like you are concerned about the scenario where multiple promotions may be seen, but only the last one sent receives credit. This is how Google Analytics handles attribution for internal promotions, so there’s no way to circumvent it. It may help to label and track only your most important promotions, which would reduce the amount of “noise” in the data. This could provide a balance between tracking multiple promotions and having reliable attribution.

      It would likely be useful to have an “internal promotions path” report that could show you all promotions viewed and clicked in sequence before completing a transaction; something like the multi-channel path report. This isn’t possible within GA, but it could be built as a custom external report using the hit data that GA captures.

      We would be happy to discuss your particular situation with you offline. If you give us permission to contact you via email, we’ll get in touch with you directly.

      Thanks,
      Marc

  7. Nikhil Gupta June 16, 2017 at 12:17 am - Reply

    Hi Max,

    Awesome post. Thanks a lot for writing this.
    One question – I want to treat my internal campaign as one would treat their external campaign.
    For example, if there is a campaign on an external site, a user lands on my site from that external site by clicking a link on the external site, the campaign source/medium are set according to that referral. If the user does not convert in that session, but converts sometime later (say from a new direct session, 2 days after), then also the conversion would be attributed to that source/medium as per the last referral.
    By using the method mentioned in this post, would I be able to treat my internal campaign the same way?

    Any thoughts, or alternative method would be greatly appreciated.

    Thanks,
    Nikhil

    • Max Bondarenko June 16, 2017 at 8:55 am - Reply

      Hello Nikhil,

      You can adjust the promo click event to capture values for campaign/source/medium via “Fields to set” advanced tag option.

      However, we at ClickInsight would strongly advise against setting campaign/source/medium for internal campaigns as this makes attribution analysis a nightmare. We have seen multiple companies trying to dig themselves out of this hole and it is a struggle. The intent of campaign/source/medium parameters is to capture information about external sources as they usually the ones that bring traffic to your site and cost you money and significant effort. Resting these(and this is what would effectively happen if you set campaign/source/medium fields to values from your promos) could make your external marketing efforts appear useless as all (or most) conversions will be assigned to internal promos. You can use MCF reports to potentially mitigate some of the issues with this method – but that might be challenging as you will have to figure out a different attribution model for your analysis.

      In the end decision is yours, but do consider using custom segments instead of setting campaign/source/medium fields on click.

      Best,
      Max

  8. Sushrut Vyas July 3, 2017 at 9:27 am - Reply

    Hi Guys,

    For some reason the tags are not firing on Unit Links on my website. On other hand, when I’m clicking on other ads the tag is firing. Could You Please suggest something? I want to track the sponsored Unit Links clicks on my website.

    • Max Bondarenko July 17, 2017 at 8:59 am - Reply

      Hi Sushrut,

      Do you have promo_name parameter on the “Unit links”? Also, double check for any typos.

      Best,
      Max

      • Sushrut Vyas July 20, 2017 at 9:11 am - Reply

        Hi Max,

        From what I’ve figured out, the tag is not firing for all the Google sponsored ads since the ads are in Iframe is what I’ve read. Could you please suggest a way out. The tag just wont fire for the Google sponsored promotions esp the Unit Links which redirect you to another URL.

        • Max Bondarenko July 20, 2017 at 9:17 am - Reply

          Hi Sushrut,

          In that case you might consider adjusting your click tracking to “Any Clicks” from “Just Links” and add data attributes to elements containing iframes or ifrsmse themselves. via a custom scripts.

  9. Kristin Gillern July 19, 2017 at 4:36 pm - Reply

    Your screen shot for the “Click – Promo Click -ID Found” trigger is different than what I am experiencing. Tag Manager is requiring another entry after RegEx (ignore case). In the case of “Promo ID” would I add the variable promo_id? I thought this was already identified by selecting Promo ID.

    • Max Bondarenko July 20, 2017 at 9:11 am - Reply

      Hello Kristin,

      Probably the screenshot is not very clear but the value of that field should be set to .+

  10. Andriy Verbickiy December 14, 2017 at 12:55 pm - Reply

    Hello, from Ukraine Max Bondarenko.Thanks for the work you’ve done!
    But is this manual still actual?
    I can not find marketing panel in E-commerce, may be google simpled it?
    https://image.prntscr.com/image/jlKw6t7cSNujPJgiyCek3A.jpg

    • Marc Soares December 14, 2017 at 2:04 pm - Reply

      Hi Andriy,

      Looks like you haven’t enabled “Enhanced” Ecommerce reporting in your Google Analytics view. You should follow the instructions in Step 1 above to enable Enhanced Ecommerce. You will then see the Marketing section and Internal Promotions reports.

      Marc

  11. emil January 2, 2018 at 1:47 pm - Reply

    Slick! I have to test this implementation. Going through the instructions:

    1. In the second custom html tag. You wrote “This tag should fire on the “Click – Promo Click – ID found” and “Click – Promo Click – Name found” triggers” ..doesn’t it add a “or” condition when you select two triggers? is this fine?

    2. Do you see any problems to setup if the site is already using enhanced ecommerce using datalayer?

    • Marc Soares January 4, 2018 at 9:56 am - Reply

      Hi Emil,

      1. Yes, it is intended to be an OR condition. This means that you could use Promo ID or Promo Name or both to label your promotions. GA requires at least one of ID or Name to be set for each promotion.

      2. There shouldn’t be any issues implementing internal promotion tracking on a site that is already using enhanced ecommerce. In this case, Step 1 (enabling enhanced ecommerce in GA) is likely already done.

      Hope that helps!

      Marc

  12. emil January 8, 2018 at 5:44 am - Reply

    Thanks! Do you see any problem using this for House ads reserved via DFP? The link parameters are visible but the link itself will have a target _blank? The code looks like this https://drive.google.com/file/d/1dxl7BnJdV5lUsThy6GZvkrSL4t1S6yOO/view?usp=sharing

    Im also wondering if I need to make changes to the variables.

    • Marc Soares January 9, 2018 at 11:27 am - Reply

      Hi Emil,

      In theory, this general approach will still work. However, it looks like the promo parameters are encoded in the URL, so using auto-event variables with Element URL / Query won’t work. GTM won’t be able to retrieve the parameter values since they are actually embedded with the “adurl” parameter. You would have to use custom JavaScript variables to parse the appropriate parameter values out of the URL for Promo Name, ID, Creative, and Position. Otherwise, everything else should work the same way.

      Marc

  13. Firman Nugraha February 1, 2018 at 4:44 am - Reply

    Great article, just what I need. One problem though, how can this be implemented for AMP pages? I found out AMP version of Google Tag Manager has fewer features compared to normal web page.

    • Marc Soares February 6, 2018 at 12:38 pm - Reply

      Hi Firman,

      Thanks for the comment. In GTM for AMP, you cannot deploy Custom HTML tags. However, there is a Visibility trigger that you could use to replicate the functionality of identifying impressions of internal promotion elements. In fact, even in a regular web container, you may wish to use the Element Visibility triggers. This post was published before built-in visibility triggers were available in GTM.

      Marc

  14. Joel February 9, 2018 at 2:44 pm - Reply

    Fascinating read! I am confused between points 2 and 3.

    Is tagging the links with params like ?promo_name=any-promo&promo_id=123 etc. not enough to pass the data to GA, just like we use utm params for external campagns?
    Why and when do you need the whole GTM setup as detailed in point 3?

    Joel

    • Marc Soares February 12, 2018 at 9:46 am - Reply

      Hi Joel,

      Thanks for the comment. The full setup is required in order to populate the Internal Promotions reports in Google Analytics. If you only tag the links with “promo” parameters, you will end up seeing these in your Pages reports when someone clicks a link, but it won’t enable the Internal Promotions reporting capability of GA. By completing the full setup, you will be able to report on both impressions and clicks of your promotional elements.

      Hope that helps!
      Marc

  15. Cori February 13, 2018 at 5:49 pm - Reply

    Hi Marc,

    I have a slider with 3 contents, these three contents link to: a search result page with a product list, a product page and a category page with a product list.
    How can I track a flow that start from one of the three contents? At the end, I want to know which content has more clicks.
    The whole slider has the attribute list name as ‘content recommendation widget’, but I don’t know how to split in each content.
    Thank you.

    • Marc Soares February 20, 2018 at 9:34 am - Reply

      Hi Cori,

      You will need to label each of the 3 links in order to differentiate the clicks. If you are able to append query parameters to the links, you can follow the directions in Step 2 above.

      If you cannot append parameters to the links, you would have to use some other attribute or the href of the link in order to differentiate which one was clicked.

      Marc

  16. Eric May 16, 2018 at 3:10 am - Reply

    Hi,
    I got false warning at the tag 2.
    var promo_name = {{Promo Name}};
    var promo_id = {{Promo ID}};
    var promo_creative={{Promo Creative}};
    var promo_position={{Promo Position}};

    When I change them like the tag 1, it will be all right. Like so:
    var promo_name=’promo_name’;
    var promo_id=’promo_id’;
    var promo_creative=’promo_creative’;
    var promo_position=’promo_position’;

    Also there is a “;” after promo_id missed.

    • Marc Soares May 16, 2018 at 9:29 am - Reply

      Hi Eric,

      Did you create the {{Promo Name}}, {{Promo ID}}, {{Promo Creative}}, and {{Promo Position}} variables as described at the beginning of Step 3? If you reference a variable that does not exist, GTM will throw an error when it validates your code.

      Marc

    • Eric May 16, 2018 at 9:46 am - Reply

      oh really. I used parameter “promo_name” as the varaible name. Sorry

      • Marc Soares May 22, 2018 at 5:52 pm - Reply

        No worries. We’ve also fixed the missing semicolon. Thanks for pointing it out.

  17. Dmitry May 20, 2018 at 6:33 pm - Reply

    In “Custom HTML tag to track promotion views. This tag should fire on the “DOM Ready” trigger and it will contain the following code” you missed a semicolon in var promo_id=’promo_id’//change to your query parameter if needed

    Should be var promo_id=’promo_id’;//change to your query parameter if needed

    • Marc Soares May 22, 2018 at 5:51 pm - Reply

      Hi Dimitry. Thanks for noticing the omission in the code. It has been fixed!

  18. Anthony September 12, 2018 at 1:07 pm - Reply

    Very informative post, super useful! I’m working to troubleshoot my implementation of it. My GA is showing internal campaigns views, but not clicks. Any suggestions would be appreciated. I’ve combed through your screenshots, and everything matches.

    • Heather Murphy September 14, 2018 at 10:23 am - Reply

      Hi Anthony,

      Glad you found the post useful! Is it possible that there is a typo in the scripts, or an error in the GTM configuration?

      Thanks,

      Heather

  19. Claire S November 18, 2019 at 6:30 pm - Reply

    Hi, I know I’m a little late to the party, but I’m having trouble with this. I’m not getting any data in GA after following the steps, so I’m trying to figure out what’s happening. In GTM Preview mode, I can see that Promotion View is firing on DOM Ready, and the GA Tag is firing on promotionView. After Promotion View fires, the data layer values are as such:

    {
    event: ‘promotionView’,
    ecommerce: {promoView: {promotions: [{name: ‘estie_lilac’, position: ‘headline’}]}},
    gtm.uniqueEventId: 14
    }

    So the data layer is capturing the name and position (which are the only variables I used in my link), but when I go to the variables tab of the GTM preview pane, each of the custom variables says “undefined” for the return type and the value. Where’s the missing piece? Thank you!

    • Marc Soares November 20, 2019 at 5:32 pm - Reply

      Hi Claire,

      Your ecommerce variable in the data layer looks correct. Do you see the internal promotion dimensions being sent in the GA event? You can inspect the GA hit in your browser using the developer console or an extension like Omnibug (https://omnibug.io/). If you see the promotion data in the event hit, then the issue is likely in your configuration or filters in GA.

      The custom Auto-Event variables will only be populated on the promotion click event. So, it’s fine that these are undefined on the promotion view.

      Hope that helps you further debug the issue.

      Marc

Leave A Comment