How can i get the ID or title of the current exprience in the page where is tested? | Community
Skip to main content
June 3, 2017
Solved

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

  • June 3, 2017
  • 11 replies
  • 13269 views

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.
Best answer by ParitMittal

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
October 16, 2018

Thanks for the info!