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

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

  • August 9, 2019
  • 3 replies
  • 304 views

Rudi
QPN Level 3 ●●●
Forum|alt.badge.img+16
  • QPN Level 3 ●●●
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

Best answer by Rudi

I have found the solution, You can access the data layer as a static value in the intercept

3 replies

Rudi
QPN Level 3 ●●●
Forum|alt.badge.img+16
  • Author
  • QPN Level 3 ●●●
  • Answer
  • August 14, 2019
I have found the solution, You can access the data layer as a static value in the intercept

Forum|alt.badge.img+2
  • June 4, 2020

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


Rudi
QPN Level 3 ●●●
Forum|alt.badge.img+16
  • Author
  • QPN Level 3 ●●●
  • June 10, 2020

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