nationalarchives / legacy-tna-google-tag-manager-scripts

All scripts to be added into google tag manager can be found here.
MIT License
4 stars 1 forks source link

FE dev: Tracking for promo events for What to expect guide #78

Closed hoake closed 4 years ago

hoake commented 5 years ago

Script development for

Dependencies

Tasks that look for meta tags and send to the dataLayer

Ecommerce tracking

When there is a Discovery details page with <meta name="Dcsext.wteg " content="What to expect guide" /> Push the following to the dataLayer

Push the following Promo click to the dataLayer (a promo view check and object has already been created)

"event": "promotionClick",
  "ecommerce": {
    "promoClick": {
      "promotions": [{
        "id": "ivp",
        "name": "Image Viewer Watermarked",
        "creative": "Image viewer",
        "position": "Below record description"
      }]
    }
  }

Acceptance/test criteria - DEV/LOCALHOST

What to expect guide pages (WO 95)

In the dataLayer:

hoake commented 5 years ago

Sorry it's so long. Let me know if you would like it split up

hoake commented 5 years ago

Hey James, I'm so sorry but I've missed a very small but very important part of the PromoView snippett. The snippett should be wrapped in "ecommerce": {}. Apart from my mistake it's in the dataLayer as expected but doesn't get picked up by GTM. I've amended the script above (it's the first one)

hoake commented 4 years ago

It's working great on test, thanks so much @JamesWChan and @punalsc