How to store datalayer element in embedded data using Site Intercept with value from Javascript | XM Community
Solved

How to store datalayer element in embedded data using Site Intercept with value from Javascript

  • 9 August 2019
  • 3 replies
  • 162 views

Userlevel 4
Badge +16
  • QPN Level 3 ●●●
  • 162 replies
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
icon

Best answer by Rudi 14 August 2019, 18:54

View original

3 replies

Userlevel 4
Badge +16
I have found the solution,
You can access the data layer as a static value in the intercept
Badge +2

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

Userlevel 4
Badge +16

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.datalayer[0].<…>.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