To pass A/B test variation name into a Google Analytics event to track impact of A/B tests , It is needed to create an HTML offer inside Adobe Target and then in that offer we can write the JS code to pass data to Google Analytics and then apply the offer to an Experience inside an Activity (Campaign) . Please follow the below steps to achieve the same :

  • Login to Adobe Target
  • Add a new HTML Offer (Offers > Create > HTML Offer)
  • Name the offer say "Testing Offer"  configure and paste in the JavaScript code (with the tags intact)

NOTE: You may customize the below  Google Analytics code as per your need. Here’s the script:

    <script type="text/javascript">
    alert("Your Campaign name is " + '${}' + " :Your Experience name is "+ '${}'+" :Your campaign Id is "+'${}' +" :Your Experience ID is "+ '${}' + " :Your Experience Traffic Type is "+'${campaign.recipe.trafficType}');
    var sCampaignName='${}';
    var sExperienceName = '${}';
    _gaq.push(['_setCustomVar',1,'Target' + sCampaignName,sExperienceName,1]);
  • If using Form Based Experience Composer then  Please click "Content" arrow ">"  inside the experience to apply the offer to experience
  • If using Visual Experience Composer, Once the Page Loads in an Experience , When you click on a page element which you want to replace with the offer , a menu shows the options that are available for that element type. Click Swap Offer and then select the the offer say "Testing Offer" from content / Offer library.
  • For Validation & Testing , we have put alert in offer created above & output will be similar to the snapshot shown below