Expand my Community achievements bar.

Ask our product team on how to best grow your experimentation and personalization strategies with Target during our AMA on May 6th!

sending Target at_property with mbox

Avatar

Level 9

I have seen such an exam question:

Michael_Soprano_0-1744027705275.png

 

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/fun...

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

4 Replies

Avatar

Level 5

It refers to this code:

GigiCotruta_0-1744031792995.png

 

Avatar

Level 9

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/fun...

 

 

Avatar

Level 5

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. 

GigiCotruta_0-1744280492954.pngGigiCotruta_1-1744280558145.png

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

GigiCotruta_2-1744280692267.png

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. 

Avatar

Level 9

Thanks very much!

So what is from your perspective art-of-state Target implementation with Data Collection in 2025?

What I did:

1. Create two properties in Target (Dev and Prod):

Michael_Soprano_0-1744742149908.png

2. Created two Datastreams in Data Collection. 

Dev Datastream mapped to dev property and dev Target environment

Prod Datastream mapped to prod propery and Target  prod environment

Michael_Soprano_1-1744742235553.png

3. I create one Tag. In the Web SDK Extension I put:

Prod Datastream for Prod Tag ENV

Dev Datastream for Dev Tag ENV

Michael_Soprano_2-1744742447928.png

4. Tag Environements. I have got three different scripts. I put one script from Production into Production WWW and then Development into Dev Environment like that:

Michael_Soprano_3-1744742798514.png

5. What do you think about that? Should I use that? It would be then included in Target reporting?

Michael_Soprano_4-1744742889723.png