Opinions on pushing DigitalData events to Google DataLayer through JavaScript | Community
Skip to main content
Level 2
November 25, 2024
Solved

Opinions on pushing DigitalData events to Google DataLayer through JavaScript

  • November 25, 2024
  • 2 replies
  • 1641 views

Hi Team,


I would appreciate your expert opinion on an approach I have been working on.

A client’s website utilizes both Adobe Analytics and Google Analytics. All implementations are currently managed through Adobe Launch, leveraging the digitalData object. The client has requested that events in the digitalData object be pushed into the Google dataLayer to trigger tags in GTM.


To meet this requirement, I have developed a JavaScript solution, deployed as a custom HTML tag in GTM across all pages. This solution monitors every change in the Adobe digitalData object, captures the event key and event data for each change, and pushes these into the Google dataLayer with the same structure. So far, the solution is working as expected.

My questions are as follows:

  1. Will this approach reliably capture every event occurring in the digitalData object and push it into the Google dataLayer?
  2. Are there any potential pitfalls, limitations, or edge cases that could cause this solution to fail?

I look forward to your valuable insights.

Best answer by Jennifer_Dungan

I agree with @bjoern__koth about having the developers push to both data layers at the same time... having to listen for changes in one data layer, to push into a second data layer is going to be a slower way to get the information, and there is more potential for JS errors to occur.

 

As for having multiple data layers, there is a balance between optimization and separation of concerns...  I keep my Adobe and GTM data layers separate because if one breaks, the other one may still be fine and continue tracking....  if they are completely coupled then you potentially lose visibility into issues...

 

I like using GA and Adobe data as comparisons of one another, making sure they trend the same way (both go up, both go down, both stay constant, etc), even if they values don't fully match, the patterns should... and if they diverge, it's a good chance something has broken and to investigate... 

2 replies

Amruthesh_AG
Community Advisor
Community Advisor
November 25, 2024

@santosh_sharma  your implementation should work to track both the analytics.

digitalData is just a object that used to trigger a event and set the its correspondence required value in data layer.

it will not have any impact on data collection.

make sure that validate thoroughly on lower environment.

bjoern__koth
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
November 25, 2024

Hi @santosh_sharma 

the more components are involved in your approach, the higher the delay between the push to digitalData, detecting the change and pushing it to the dataLayer be.

 

The probably cleaneast way would be asking your developer to push the data straight into the GTM dataLayer and your digitalData at the same time.

This would likely be only a single line of code for the devs.

 

Of course, it is not ideal to have multiple data layers in place.


Maybe this could be interesting for you:
https://experienceleague.adobe.com/en/docs/experience-platform/tags/extensions/client/google-data-layer/overview

 

Adobe Launch has an extension that can listen to the Google DataLayer. This would require a bit of restructuring on your Launch side, but could overall be the cleanest approach.

 

Cheers from Switzerland!
Jennifer_Dungan
Community Advisor and Adobe Champion
Jennifer_DunganCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
November 25, 2024

I agree with @bjoern__koth about having the developers push to both data layers at the same time... having to listen for changes in one data layer, to push into a second data layer is going to be a slower way to get the information, and there is more potential for JS errors to occur.

 

As for having multiple data layers, there is a balance between optimization and separation of concerns...  I keep my Adobe and GTM data layers separate because if one breaks, the other one may still be fine and continue tracking....  if they are completely coupled then you potentially lose visibility into issues...

 

I like using GA and Adobe data as comparisons of one another, making sure they trend the same way (both go up, both go down, both stay constant, etc), even if they values don't fully match, the patterns should... and if they diverge, it's a good chance something has broken and to investigate... 

Level 2
November 26, 2024

Thanks @jennifer_dungan, and @bjoern__koth,

 

We had to adopt this solution as our agency manages only the Google side of the client's work, while the agency responsible for the Adobe side is unable to implement the required changes at this time due to some ongoing issues. Additionally, given the time constraints with the development team, leveraging Adobe digitalData was the only feasible option for us.

 

So, would this approach be effective, at least for a quarter, until support from the Adobe side or the development team becomes available?