Expand my Community achievements bar.

Join us on September 25th for a must-attend webinar featuring Adobe Experience Maker winner Anish Raul. Discover how leading enterprises are adopting AI into their workflows securely, responsibly, and at scale.

Adobe Data Layer - Array Length

Avatar

Level 3

Hey,

 

We are currently leveraging the Adobe Data Layer for tracking page changes via event pushes on SPA pages.

 

Can anyone provide any guidance / experience regarding the impact of not setting a limit on the number of data later push / objects that are present in the Adobe Data Layer. 

 

For a given session:

  • A user may spend an extended amount of time on a page/ site thus extended the Adobe dataLayer
  • Potential impact to mobile users? Bandwidth / Network impact if any?

 

Is there any potential impact from an Adobe Web SDK capturing perspective?

 

Thanks,

Ty

7 Replies

Avatar

Community Advisor

Hi @tyrese 

I would not care about the number of items in the data layer. That's an array that will likely never reach its maximum length. I would rather be concerned of potentially sending a LOT of billable server calls. Since these calls will likely not happen at the same time, the overall used bandwidth should be negligible.

 

I would recommend checking what tracking calls and data layer pushes actually make sense from a reporting perspective.
There appears to be a lot of background noise on your pages.

Cheers from Switzerland!


Avatar

Level 3

Hey @bjoern__koth 

 

We are currently leveraging the dataLayer pushes as a method of tracking page changes on SPA pages - are you saying that these dataLayer pushes have an impact on billable server calls? If so can you provide any Adobe Documentation explaining this?

 

Thanks,

Ty

Avatar

Community Advisor

Hi @tyrese 

only if you are mapping the data layer pushes to any kind of analytics tracking call.

 

In general, any push to the data layer without triggering a tag (marketing or analytics side) won't do anything to the performance of the website.

In theory, you can - had to look it up - push 4,294,967,295 (2^32 - 1) items to your dataLayer which is rather unlikely to reach 😉

 

Bottom line: the data layer is extremely lightweight, so there is no harm in using it for your SPA changes.

Cheers from Switzerland!


Avatar

Level 3

Hey @bjoern__koth in this scenario we are leveraging the event dataLayer push to trigger the  Adobe Web SDK. Does that change anything?

 

Also where did you find that item limit count? Can you provide the link?

 

Thanks,

Ty

Avatar

Community Advisor

It's the actual limit of javascript arrays 😅

 

as I said, I don't see an issue. Tracking of state changes with WebSDK is standard.

Cheers from Switzerland!


Avatar

Level 3

Hey @bjoern__koth 

 

thanks for the adding information and confirmation on the impact.

 

I developed this ahead of time - it may still be useful to any other individuals looking to trim the number of dataLayer objects whilst maintaining the [0] object and the most recent object.

 

if (adobeDataLayer.length > 20) {

    const first = adobeDataLayer[0];

    const last = adobeDataLayer[adobeDataLayer.length-1];

    adobeDataLayer.length = 0;

    adobeDataLayer.push(first,last);

}

 

Thanks,

Ty

Avatar

Community Advisor

I mean technically you can do whatever you want with the adobeDataLayer, but I think you won't need to.

I have seen AEM pages that push all sorts of component show events, ending up with 100+ items in the data layer and never experienced problems with that. 

Obviously, you can argue whether all of these pushes were necessary (imho they weren't), but this is what the AEM core components do out of the box.

 

But glad to hear that you came up with a solution that works for you.

Cheers from Switzerland!