sending Target at_property with mbox | Community
Skip to main content
Michael_Soprano
Level 10
April 7, 2025
Question

sending Target at_property with mbox

  • April 7, 2025
  • 1 reply
  • 593 views

I have seen such an exam question:

 

ChatGPT advise something like that:

 

<script>
window.targetGlobalSettings = {
property: "your-property-token-here"
};
</script>

 

However I do not see that property in window.targetGlobalSettings():

https://experienceleague.adobe.com/en/docs/target-dev/developer/client-side/at-js-implementation/functions-overview/targetglobalsettings

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

GigiCotruta
Level 4
April 7, 2025

It refers to this code:

 

Michael_Soprano
Level 10
April 10, 2025

Is it also compliant with at.js?

So if I would like to have Dev and Prod then I set up two properties and then put that snippet above at.js code?

 

<script>
function targetPageParams() {
return {
"at_property": "property_for_dev"
};
}
</script>

// at.js for dev

<script src='at.js'>

</script>

 

Unfortunately its not explained here: https://experienceleague.adobe.com/en/docs/target-dev/developer/client-side/at-js-implementation/functions-overview/targetpageparams

 

 

GigiCotruta
Level 4
April 10, 2025

If you have your connection via WEB SDK, aka, datastream integration, I wouldn't encourage you using at.js. It's either one or the other. I am recommending Web SDK, it is a little bit more confusing, indeed, but it is faster and better integrated with your CDP. 

 

If you want to have dev and prod, link those separated environments using your datastream integration. In your prod mbox, use the prod environment from Tagret, for the DEV sandbox, use the dev environment from Target. 

You basically don't need any snippet code with web SDK as long as you already have your Tag script in place. 

If you have this script in your head section of the web page you are trying to use target on, using the datastream connection it will connect without any problems.