Expand my Community achievements bar.

Opinions on pushing DigitalData events to Google DataLayer through JavaScript

Avatar

Level 2

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.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

7 Replies

Avatar

Level 4

@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.

Avatar

Community Advisor

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-la...

 

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!


Avatar

Community Advisor and Adobe Champion

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... 

Avatar

Level 2

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?

Avatar

Community Advisor and Adobe Champion

Ah, yeah, this complicates matters... what all do you have access to? You mentioned the agency responsible for the Adobe side is unable to support at this time.. is that just the coding for the Data Layer? Do you have access to Launch to make changes, or is that outside of your control too?

 

Given that Launch is capable of doing more than GTM, including listening for and pushing to the GTM Data Layer... I wonder if you could leverage that to help your solution.. if not, it sounds like while not ideal, the solution you have is probably your best bet.

Avatar

Community Advisor

@Santosh_Sharma how does your current approach look like?

I mean, Launch has its own "Data Element Change" rule trigger you can listen to, but it also states exactly, that it is polling changes to your data element which may lead to timing issues should your browser navigate away i.e., potentially delayed/lost pushes to the dataLayer.

bjoern__koth_0-1732597104030.png

 

Cheers from Switzerland!


Avatar

Community Advisor and Adobe Champion

Yeah, this was what I was thinking too... use Launch to listen for and push a replication of the data layer... If they have access to Launch... rather than trying to do this with custom code in GTM.

 

in fact the "push through to GTM Data Layer" could be done in the existing Adobe Rules as secondary action within the rules that already exist.