How to store datalayer element in embedded data using Site Intercept with value from Javascript | XM Community
Skip to main content
Hi all,

I need to access a data layer in order to store a value. Unfortunately, I have no clue how to approach this.

It would be great if anyone could let me know the proper approach



Thanks a lot for your support

Best regards

Rudi
I have found the solution,

You can access the data layer as a static value in the intercept

Hi Rudi! I am trying to do the same thing. Could you please share your process?


Hi Erin,
sorry for getting back late on your query but I was on leave.
Actually it was much simpler as I anticipated. Assuming that the data layer element is called SomeId.
As you certainly know you go to Intercept -> Options -> embedded data
Enter the name of the embedded data field and choose Value from JavaScript then the syntax is something like window.datalayerr0].<…>.spiceID. This <…> is variable and you need to ask the owner of the website how this is organized.
I hope this helps
Best regards


Leave a Reply