Expand my Community achievements bar.

SOLVED

Has anyone used the app measurement variables to go into websdk as a websdk variable for AEP ?

Avatar

Level 4

Hello everyone, 
Has anyone used adobe's app measurement "s" variable and mapped it to the "_data" variable in WebSDK ? 
I have successfully done the above part using the method Rajdeepsingh posted https://medium.com/@rajd33p/web-sdk-for-adobe-analytics-the-best-possible-way-to-collect-data-6a54a9...

gmadala_0-1727752001646.pnggmadala_1-1727752026749.png

 



, however now I would like to send this to to AEP through a datastream so that I can eventually use it in CJA. 
I do not want to use the Adobe analytics experience event template schema, rather want to use something custom schema but wasnt sure how the product string and other variables would be designed. Has anyone successfully implemented anything of this sort ? 
Any suggestions will be appreciated.

Thanks

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

No, this fieldgroup is the official, tool-agnostic way to get product data into AEP through XDM

 

data.__adobe.analytics.products is an alternative that makes many things easier when you are only using Analytics, but this data will not end up in AEP automatically. 
hence the namespace data.__adobe.analytics


essentially, if your data layer does not yet provide exactly the format that the XDM expects, you will have to do some coding I presume to bring your products into the desired format. At least I have not seen a simpler approach for an easy mapping to the XDM fieldgroup as an array of objects.


Bottom line: if you have more Adobe tools attached to AEP, or other 3rd party connectors that use product information, set the productListItems. If you only have AA, I would go with data.__adobe.analytics

Cheers from Switzerland!

View solution in original post

15 Replies

Avatar

Community Advisor

Hi @gmadala 

let aside CJA for a moment: how does your current setup look like?

 

Meaning

  • do you have a datastream set up yet with Adobe Analytics connected to it?
  • do you have Web SDK in place, sending information to this datastream? Is your custom code part of an update variable Web SDK action?

The data.__adobe.analytics in your screenshot should - when send in a Web SDK request - automatically get mapped to the corresponding Adobe Analytics props/eVars/events/list1/products (you may want to append an "s" to your "s.product")

 

 

Cheers from Switzerland!

Avatar

Level 4

Hello @bjoern__koth , 
I dint make any changes for my adobe analytics data collection method, rather added an additional action to update the websdk variable and send the event to AEP datastream. 
I do not have a adobe analytics datastream and do not intend to have one according to my strategy. 
I just have the websdk variable data._adobe.analytics that has the custom code of s.product or s.evar etc. 
I now need to understand what schema would work better because I do not want to use the adobe analytics experience schema

Avatar

Community Advisor

Hi @gmadala 

 

Adobe is actually also discouraging you from using their _experience.analytics fieldgroup if you intend to use CJA in the near future.

What exactly are you trying to to with your data.__adobe.analytics data then, since it is mostly useful if you want to automatically map this data to AA through a datastream.

 

 

Maybe this is helpful

https://medium.com/@rajd33p/adobe-analytics-to-adobe-experience-platform-your-guide-to-the-next-best...

it contains a pretty cool flowchart that maybe lays out some more options

 

bjoern__koth_0-1727805698721.png

 

Cheers from Switzerland!

Avatar

Level 4

You are absolutely right. I do not have a AA datastream for now. 
My current efforts are to make sure the data lands into AEP through websdk but instead of the XDM{} data variable I thought ill use the data{} because its easier to send it with existing appmeasurement custom code. 
Though the data{} will not automatically land into the AEP but is there a possibility I could use dataprep to do it.  

Avatar

Community Advisor

yes, you are right. it is just context data that must be mapped in data prep onto your XDM fieldgroup to make it usable.

you can do so in the datastream configuration.

https://experienceleague.adobe.com/en/docs/experience-platform/datastreams/data-prep

 

for another client I use the data prep to map the ECID to a specific analytics eVar (using the _experience.analytics fieldgroup)

Cheers from Switzerland!

Avatar

Level 4

My usecase and approach might be very intentional. 
But lets saw for instance I have every rule in launch through websdk has mapped out to the data{} object instead of xdm{} object, because I dont need a schema to send data {} object rather for xdm{} its asking for a schema. 
Second question-just like how you mentioned you used ecid as context data and mapped in dataprep. Do you think I could do that for all variables for the time being.? So that this way its easier to send the data from launch through websdk to AEP, only burden would be to maintain the data prep setting every single time.

 

Avatar

Community Advisor

Hi @gmadala 

I you are completely free to map your custom data to anything in the standard Adobe XDM schema in data prep as calculated fields.

But that is the point. Ultimately, may find cases where you will start to create your own XDM schema fieldgroup to make it easier to onboard data from other systems where you do not have your classic props, eVars and events that implicitly are treated as strings and integers.

 

Dataprep gives you some additional flexibility if you need additional logic to be applied on an icoming value of a system which data you e.g., cannot transform before it comes in. Just bear in mind that setting a lot of these mappings and calculations up makes it a lot harder to debug that the system is actually doing what it is supposed to. Getting clean data in in the first place surely reduces this need drastically.

 

Cheers from Switzerland!

Avatar

Level 4

I see, 
Okay I understand. 
Is there a way to map the adobe S variable ( from app measurement ) to XDM variable in launch rules ? 
This is where I need help to understand. 

Avatar

Community Advisor

the easiest approach is using a Web SDK update variable action and in the custom code use this as starting point if you want to use the "s" object with code.

else, you also directly set the props/eVars in that action.

 

content.__adobe = content.__adobe || { };
content.__adobe.analytics = content.__adobe.analytics || { };
let s = content.__adobe.analytics;

// s.eVar99 = "Hello world";

 

there are similar threads about this topic e.g., here and here

Cheers from Switzerland!

Avatar

Level 4

@bjoern__koth , got it, that works. 
For context, I am using the 

 content._tenant = content._tenant || {};
content._tenant.analytics = content._tenant.analytics || {};
let a = content._tenant.analytics;
a.pageName = s.pageName;

_tenent.analytics would be my custom analytics fields but I am mapping them to a few from "s" object, since I do not want to use the adobe analytics experience template. or I could have used the _experience.analytics so that it auto maps. 

Problem where I get stuck is the s.product to be mapped within XDM variable with custom code. 
I dont know if I could use the productlist{} = s.product. Not sure if it auto maps to each layer of product string
 

Avatar

Community Advisor

Why don't you use content.data.__adobe.analytics.products? This will automatically get mapped and takes exactly the products string that AppMeasurement used to.

Cheers from Switzerland!

Avatar

Level 4

@bjoern__koth 
I could but the __adobe.analytics.products doesnt automap to AEP right ? My datastream is to AEP platform. 
Please let me know your thoughts, if I am missing something.

Avatar

Community Advisor

Yes, it really is an AA specific automatic mapping. If you want to go all AEP, use the productListItems array

https://experienceleague.adobe.com/en/docs/experience-platform/xdm/data-types/product-list-item

https://github.com/adobe/xdm/blob/master/components/datatypes/productlistitem.schema.json

This will also get auto-mapped to the AA products

Cheers from Switzerland!

Avatar

Level 4

@bjoern__koth , 
I did look into this. I created my own product list but wasnt that successful when it comes to mapping multiple products. 
Assuming I have 30 products and each product is split by "," like regular s.products. 
Do you say that if I initialize as productlistitem =s.products
It gets automapped? 

 

Avatar

Correct answer by
Community Advisor

No, this fieldgroup is the official, tool-agnostic way to get product data into AEP through XDM

 

data.__adobe.analytics.products is an alternative that makes many things easier when you are only using Analytics, but this data will not end up in AEP automatically. 
hence the namespace data.__adobe.analytics


essentially, if your data layer does not yet provide exactly the format that the XDM expects, you will have to do some coding I presume to bring your products into the desired format. At least I have not seen a simpler approach for an easy mapping to the XDM fieldgroup as an array of objects.


Bottom line: if you have more Adobe tools attached to AEP, or other 3rd party connectors that use product information, set the productListItems. If you only have AA, I would go with data.__adobe.analytics

Cheers from Switzerland!