Hi in this article we will learn how we can store and fetch the profile script in Adobe target webSdk, As in webSdk we use alloy send event method to push the data on the edge server and to fetch the data from the edge server , in websdk version all the adobe target data and analytics data store in edge server only and to sync between edge server and adobet target to analytics we use the dataStreams
A datastream represents the server-side configuration when implementing the Adobe Experience Platform Web and Mobile SDKs. While the configure
 command in the SDK controls things that must be handled on the client (such as the edgeDomain
), datastreams handle all other configurations for the SDK.Â
For more details you can check the below url
https://experienceleague.adobe.com/en/docs/experience-platform/datastreams/overview
So through alloy.sendEvent method we can send dta to edge server as profile script and if we need to call the profile script on our code we can directly write ${profile.objectName} adn able to call the value of stored profile script.
Now lets see the method to store the data in profile script, please check the below code
<script>
var data = { "__adobe": { "target": { "profile.valueOne": 'true', "profile.valueTwone": 'true' } } };
targetXDMObj = { "eventType": "web.webInteraction.linkClicks", "web": { "webInteraction": { "linkClicks": { "value": 1 }, "name": "target", "type": "other" } } };
try { alloy("sendEvent", { decisionScopes: ["__view__"], data: data, xdm: targetXDMObj }); }
catch (err) { }
</script>
In above code we are are storing “profile.valueOne”: ‘true’ , “profile.valueOne”: ‘true’ as adobe target profile attributes and the we are sending alloy.sendevent call in which we are passing the data and decisionScopes as view so once the call will sucessfull the it will store the profile attributes in edge server and we can recall the any time
Below is the method to recall them, While you are creating any target activity A/B Testing , XT activity you acna call the profile paremeters withing the activity by using below code
console.log('${profile.valueOne} , sumit:form: ${profile.valueOne}');
return true , true // string type