Skip to main content
Jun 3, 2017 11:19 AM UTC
Solved

How can i get the ID or title of the current exprience in the page where is tested?

For example , I make Experiences A and Experiences B , and deploy on my site, now I want get the current experience name or id  with javascript , how should i do ?

thanks a lot !

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
ParitMittal
ParitMittalAccepted solution
Level 10
Jun 5, 2017 6:38 AM UTC

Hi ,

As suggested by Thomas, You can use the pass the below code in custom code section of each experience variation of the test to fetch the experience ID etc.

<script type="text/javascript">

var sCampaignName='${campaign.name}';

var sExperienceName = '${campaign.recipe.name}';

var scampId='${campaign.id}';

var sExpId=${campaign.recipe.id}'

alert("Your Campaign name is " + '${campaign.name}' + " :Your Experience name is "+ '${campaign.recipe.name}'+" :Your campaign Id is "+'${campaign.id}' +" :Your Experience ID is "+ '${campaign.recipe.id}' );

</script>

Regards

Parit Mittal

11 replies

AliMaleki
Level 4
Oct 16, 2018 8:23 PM UTC

Thanks for the info!

Translate