Search code examples
google-tag-managerenhanced-ecommerce

Can I split Google Tag Manager promotion view in many tags


I'm implementing a Google Tag Manager data layer. Until now I have most of the Enhanced Ecommerce setup successfully.

When implementing the promotion view tag, I see in all the examples that I found a single tag being pushed with a list of all the promoFieldObjects. i.e.:

dataLayer.push({
  'ecommerce': {
    'promoView': {
      'promotions': [                     // Array of promoFieldObjects.
      {
        'id': 'JUNE_PROMO13',            // ID or Name is required.
        'name': 'June Sale',
        'creative': 'banner1',
        'position': 'slot1'
      },
      {
        'id': 'FREE_SHIP13',
        'name': 'Free Shipping Promo',
        'creative': 'skyscraper1',
        'position': 'slot2'
      }]
    }
  }
});

Happens that in my application it is way easier to push the promotions in 4 different promotion view tags, since they are rendered in groups by several different decoupled react components.

So, my question is if there is any downside in splitting this tag in multiple instead of a single big one, like:

dataLayer.push({
  'ecommerce': {
    'promoView': {
      'promotions': [
      {
        'id': 'JUNE_PROMO13',
        'name': 'June Sale',
        'creative': 'banner1',
        'position': 'slot1'
      }]
    }
  }
});

and

dataLayer.push({
  'ecommerce': {
    'promoView': {
      'promotions': [
      {
        'id': 'FREE_SHIP13',
        'name': 'Free Shipping Promo',
        'creative': 'skyscraper1',
        'position': 'slot2'
      }]
    }
  }
});

Solution

  • When you split it, I think only the last one will be "seen" by GA. This is because the second push will overwrite the "promotions" property.

    I think you can get around this by keeping track of the two promotions in an array and then do an overall push.