Expand my Community achievements bar.

SOLVED

Using Geo location for Launch custom code

Avatar

Level 3

We have Web SDK set up. In our Data Stream, under GEOLOCATION AND NETWORK LOOKUP, all the checkboxes including State/Province, and Country are clicked. In the Adobe Debugger, I found this variable  xdm.placeContext.geo.stateProvince. It's set to my Country and Province.

I would like to use the value of stateProvince in a Custom Code in Launch; e.g. If xdm.placeContext.geo.stateProvince = "CA-ON", then do some action.

How can I refer to the stateProvince variable to use it in a custom code in Launch?

 

1 Accepted Solution

Avatar

Correct answer by
Level 6

@m_alcantara xdm.placecontext.geo.stateprovince is not directly accessible in Launch as web sdk doesn’t expose it globally.

 

You can try using onBeforeEventSend as it could provide access to full XDM payload, including automatically added context like placeContext.geo.stateProvince

View solution in original post

2 Replies

Avatar

Correct answer by
Level 6

@m_alcantara xdm.placecontext.geo.stateprovince is not directly accessible in Launch as web sdk doesn’t expose it globally.

 

You can try using onBeforeEventSend as it could provide access to full XDM payload, including automatically added context like placeContext.geo.stateProvince

Avatar

Level 6

@m_alcantara Hope you were able to resolve and get a resolution for the issue, if so, please mark the response as "Correct Answer" and like the post so that others in the community can find the working solutions easily.