Expand my Community achievements bar.

SOLVED

Anyone using Profile Scripts with AEP Web SDK implementation?

Avatar

Level 2

I've recently been working on a new implementation of Analytics/Target via the AEP Web SDK, and am in the process of configuring some new activities.  In the past, I've used profile scripts as an easy way to handle complex audience parameters that need some sort of calculation or persistence, but I don't see anything in the documentation that addresses how to reference XDM data in the profile script editor.  Is this even an option with the Web SDK, and if so how would I reference the XDM data when building a script?

1 Accepted Solution

Avatar

Correct answer by
Level 2

Cross posting an answer from @mosesmaxen in a recent AT Community Q&A Coffee Break:

 

@wgharper - I love this question!  XDM data can be leveraged within a profile script following a similar syntax seen below.  It is very similar to referencing a Target mbox parameter within the script.  In fact, if you start typing mbox.param into the profile script UI, you should see a drop down list of all mbox params including XDM fields to select from.  

 

mbox.param('productListItems.SKU') 

View solution in original post

5 Replies

Avatar

Correct answer by
Level 2

Cross posting an answer from @mosesmaxen in a recent AT Community Q&A Coffee Break:

 

@wgharper - I love this question!  XDM data can be leveraged within a profile script following a similar syntax seen below.  It is very similar to referencing a Target mbox parameter within the script.  In fact, if you start typing mbox.param into the profile script UI, you should see a drop down list of all mbox params including XDM fields to select from.  

 

mbox.param('productListItems.SKU') 

Avatar

Administrator

Thanks so much for cross-promoting, posting, and closing out your original question @wgharper ! 

Avatar

Community Advisor

Hi @wgharper @mosesmaxen I triggered profile param through a monitoring campaign using below code :

alloy("sendEvent", {
data: {
__adobe: {
target: {
"profile.productViewed": "pageName",

}
}
}
});

 

however, "productViewed" profile parameter is not visible under Visitor Profile section to create the audience.

I created the  profile script also but that is also not working. Any leads on how to access the profile paramters in AEP Web SDK method?

Avatar

Employee Advisor

@ambikaTewari_ATCI - It may take some time for the parameter to populate in the UI.  I would try checking once more just in case.  I would also confirm that there are no errors when the request is being made and try removing the comma after the profile parameter value in case that is causing an issue. 

Avatar

Community Advisor

Thank you @mosesmaxen  for the reply.

Actually it is more than 48 hours and  I'm not able to find productViewed (in our case profile parameter name is vehicleSeen) under Visitor Profile Section.

LordOfTheRings_0-1670484191306.png

 

I removed the comma after the parameter but still no luck.

 

the parameter is also triggering well in the network tab :

LordOfTheRings_2-1670484406442.png