Capture Activity and Experience ID in Profile Scripts? | Community
Skip to main content
Robvienna1982
Level 2
September 5, 2022
Solved

Capture Activity and Experience ID in Profile Scripts?

  • September 5, 2022
  • 1 reply
  • 3487 views

Hi,

Is there a way I can captured an Activity ID and Experience ID displayed in a Profile Script? I think I've figured out the Activity, but there's nothing documented (clearly) on how to capture the Experience ID or Name as a Profile Attribute.

 

Thanks

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

That will probably be the issue, we're not using the VEC or similar. Just using the form based composer to retrieve JSON offers. example:

 


@robvienna1982  - JSON offers are still used by a channel eventually to deliver the final experience. In that case, you have 2 approaches:

1. You can still use the dynamic parameters in JSON offer which can be read by the channel where you are delivering the final experience. From there you can execute trackEvent() call.

2. You can use Response Tokens to get the the ids of all activities and experiences, and pass these to Adobe Target using trackEvent(). Page below shows an example of sending AT data to Google Analytics - you can use Tealium Extensions to work in similar manner. 

https://experienceleague.adobe.com/docs/target/using/administer/response-tokens.html?lang=en#:~:text=Response%20tokens%20let%20you%20automatically,%2C%20geo%20information%2C%20and%20more

1 reply

Rajneesh_Gautam_
Community Advisor
Community Advisor
September 5, 2022

hi @robvienna1982  - you can capture ID of activity and experience using the dynamic parameter syntax (see below) and pass these from the activity-code using trackEvent() call. You can then create a Profile-script to read these params. 

Page-URL: https://experienceleague.adobe.com/docs/target/using/experiences/offers/passing-profile-attributes-to-the-html-offer.html 

${campaign.name}${campaign.recipe.name}${campaign.id}${campaign.recipe.id}

Robvienna1982
Level 2
September 5, 2022

Thanks, I did take a look at that but we're using Tealium so it's not so straightforward it seems, we can't add a track event. What would the profile script look like if this was possible? i.e. how would we reference these new parameters? it wouldnt be an mbox_param would it?

Rajneesh_Gautam_
Community Advisor
Community Advisor
September 5, 2022

hi @robvienna1982  - trackEvent() is part of standard Adobe Target library which is part of Adobe Target tag-template within Tealium. You can check it easily by executing following command in browser-console and hopefully you get 'function' as a result

typeof(adobe.target.trackEvent)

If this works then you can use trackEvent() as part of the experience-code as well, like below:

adobe.target.trackEvent({
 "mbox": "collect-activity-data",
 "params": {
  "activity_id": "${campaign.id}",
  "experience_id": "${campaign.recipe.id}"
  } 
 });

And profile-script code would look like below for storing activity-id. Note that you may have to alter this code according to your use-case (for example, if you want to append all the activity-ids)

if (mbox.name == 'collect-activity-data') {
 	return mbox.param('activity_id');
 }