4site-interactive-studios / engrid

The Unlicense
10 stars 4 forks source link

Update our push of EN's pageJson to the GTM Data Layer to be done in a single push #278

Open bryancasler opened 10 months ago

bryancasler commented 10 months ago

Currently, we push each attribute of EN's pageJson to the GTM Data Later one at a time; this creates message overload when debugging ( screenshot below ). We can actually do it all in a single push.

One push, multiple variables https://developers.google.com/tag-platform/tag-manager/datalayer#one_push_multiple_variables

dataLayer.push({
  'color': 'red',
  'conversionValue': 50,
  'event': 'customize'
});

This came up working with Eric (via DataHabits) while troubleshooting issues on RAN's donation pages. Here's and example, but any RAN or client page with GTM will do.

Screenshot of the individual data layer push messages. CleanShot 2024-01-02 at 10 14 41@2x