Showing posts with label Adobe Target. Show all posts
Showing posts with label Adobe Target. Show all posts
Preventing redirect loops with Adobe Target

This is a quick tip for Adobe Target users when creating redirect tests/offers. It's possible (as I discovered) that one day you need to redirect to the same page you have an A/B test running. An example could be, adding parameters to your Control URL which is then used by another data capture system. Redirecting to the same URL becomes a problem as you end up in a redirect loop *unless* you kill the mbox on the redirect. I've been aware of the mBoxDisable=1 URL debugging parameter and found it useful for developers that don't want to be part A/B tests while working in staging, but it can also be useful if you want to prevent a redirect loop, here's what it looks like:

It's worth noting that although we're making a call to disable the mbox it doesn't impact reporting, so the redirected user with a disabled mbox is still part of the test and reported on. And that's it. Maybe you find this useful, maybe not!
Adobe DTM for improved Target QA
In a previous post I described the options available for Adobe Target QA. Now with DTM there's a much easier/nicer/quicker way of doing this! (This post will take ~2 minutes to read.)
Step 1) Make sure you have the DTM browser plugin installed - it's available for Chrome and Firefox. The plugin allows you to see debug messages but also easily switch between DTM's production and staging environments which is what we want for the purpose of this post. It's worth knowing that you can recreate this functionality with some JavaScript bookmarks, so this can be used for IE or maybe you prefer using bookmarks opposed to the plugin.
Switch staging on bookmarklet:
javascript:localStorage.setItem('sdsat_stagingLibrary',true);
Switch staging off bookmarklet: javascript:localStorage.setItem('sdsat_stagingLibrary',false);
Another approach is to go to your browser's console and add the above commands without "javascript:" ....like this:
Step 2) Create an *unapproved* page load rule in DTM for adding the Mbox. If you're not sure how to do this you can read this post (it's easy).
Step 3) Switch staging to "On" using your browser plugin or bookmarklet and go to the page with the Mbox - unapproved DTM rules are rendered when you have Staging switched on - this is the *magic*. Now hit refresh a couple of times so Adobe Target gets to see the Mbox.
Step 4) Login to Adobe Target and create a campaign using the Mbox that was just created and publish (make live).
Step 5) Go back to the page with the Mbox and start your QA. Once you're sure everything works - publish the Mbox page load rule in DTM.
Easy. Any questions or comments feel free to add below.
Using DTM as your campaign targeting layer
DTM has a whole load of targeting capability which includes being able to target Mboxes. Put another way, DTM can replace your Adobe Target campaign level targeting. So why bother?
Adding targeting at the Mbox level through DTM will reduce your Mbox server calls/costs. In the past if we wanted to run a homepage test for Mac OS visitors we'd burn server calls for 100% of the visitors regardless of their OS, now with DTM as the campaign targeting layer, we're only using server calls for those that match our targeting rules:
Global Mbox strategy
If you're currently using a global mbox it does pose the question whether you'll want to continue as this will undoubtedly be more expensive. The primary reason for adopting a global Mbox strategy was to have the ability to add mboxes to any page through Target opposed to bothering IT, however you can now do this through DTM and it's *significantly* more user-friendly (a marketing person can do it) compared to adding them in Adobe Target. Here's how easy it is in DTM. So I'd recommend you disable the global Mbox in the Marketing Cloud before you download:When to use Target or DTM
There will be situations that you'll need to define targeting in Adobe Target for example at Experience or success metric level, here's how my responsibility split would look across both systems when creating an optimisation campaign:| DTM | Adding Mboxes, Campaign level targeting (including scheduling). |
| Target | Outputting content, Experience and success metric targeting, defining success metrics. |
Both Adobe DTM and Target are highly complementarity and I'd recommend you give them a spin if you haven't already. Any questions, feel free to ask below.
Remarketing cart abandoners with DTM & Target
I'm going to show you how straightforward it is to target visitors that have abandoned a shopping cart without purchasing, we'll retarget these visitors with personalised homepage content related to what was in their shopping cart, at the same time we'll run an A/B test to report on whether there's uplift. This article will demonstrate how quickly you can implement more advanced testing/targeting that prior to DTM would have involved passing parameters via mboxes and possible intervention from IT. Now with DTM we can do it in no time without having to change any page code!
Step 1) We want to target visitors that had iPhones in their shopping cart for future retargeting, to start with we'll create a 'data element' in DTM that accesses the iPhone product name from the cart, this could just as easily be a SKU/product id or other similar unique identifier. Here's what it looks like in DTM:
This is where we're grabbing the product name from:
Step 2) Now we create a Page Load rule that is triggered when our data element (from previous step) has the value 'apple iphone'. In addition we set a cookie for 30 days - this will be our retargeting window and we'll use this cookie for targeting our personalised homepage content.
And setting the cookie in the 'JavaScript / third party tags' section:
_satellite.setCookie('cart-contents-iphone', 'true', 30);
Step 3) Next we create an mbox named 'homepage-remarketing-iphone' that will wrap the remarketing content, for this example we'll assume it's the main homepage banner. So we create another Page Load rule which targets the homepage URL and we conserve our precious mbox server calls by only outputting when visitors have the 'cart-contents-iphone' cookie value set as 'true'. Prior to DTM we had to burn mbox server calls on 100% of our homepage traffic.
Step 4) Now we login to Target and create a 'Landing Page Campaign' (this forces our targeting to be evaluted every time, A/B would probably work too though). We target the mbox location: 'homepage-remarketing-iphone' and we only want visitors in this campaign that have *not* purchased, so we target our campaign with a custom segment from the 'Marketing Cloud Audiences' target of 'Non-Purchasers':
We'll use default content for the control and personalised iPhone content for the variant. Once this campaign is live we can report on whether our personalised experience is yielding incremental revenue.
What the default content/banner looks like:
And our superduper, optimised & personalised version:
How easy was that?! These type of tests before DTM could have been more of a multi-department project and now it's more like BAU.
Adding mboxes with Dynamic Tag Manager
I'm going to show you how to add Adobe Target mboxes to your pages using DTM. Combining Adobe Target with DTM can take your testing and targeting to the next level. Many organisations have areas that are difficult and time consuming to run tests/ add mboxes, such as the shopping cart. DTM removes all boundaries, in addition the complex and abstract scenarios for evoking an mbox become limitless!
Step 1) First off login to DTM and Adobe Target as a tool - this is available as a predefined option so set-up is a breeze, you have the option for managing the mbox.js file which means you now have control over updating this file. Once added your overview panel will look something like this:
Step 2) For this example I want to target an mbox in the shopping cart where the URL contains "cart".
Step 3) With the Adobe Target tool enabled we now have a new section for adding and naming mboxes. Mbox placement is done by referencing pages elements via the DOM, right-clicking on a page element and using the developer tools enabled with your browser makes this a straightforward process. In the example below I want to change the page title which can be accessed like this: h2.heading.
In total I'll change 3 elements on this page - see below how I'm referencing them:
Step 4) Login to Adobe Target and create a Campaign and Offer referencing the mbox we just created. Those with good eyes will see my new shopping cart title in the HTML offer box below: <h1>Richard's shopping basket - 100% money back guarantee</h1>
Step 5) Once we've created all our variant offers and set our TnT campaign live we can access the cart page again to see the highly optimised version:
When we inspect the page before and after we can observe the differences generated by DTM -
Before:
<h2 class="heading">Your shopping cart</h2>
After:
<div id="_sdsat_mbox_5290797208435833_" style="visibility: visible; display: block;"><h1 class="heading"> Richard's shopping basket - 100% money back guarantee</h1></div>
You may not agree however I think this is frigging awesome! Many organisations can wait months to get simple tests run in high volume funnels where small conversion gains can make a big difference. A Tag Management System utilised to it's full capability can become more of a "targeting layer" or a Targeting Management System - plain old "Tag" doesn't do it justice.
How to QA your Adobe Target campaigns
There are various ways to QA your Adobe Target campaigns, some are quicker and others more thorough ;-)
Once you tell Target your Staging and Development hosts, *unapproved* campaigns can be seen in your testing environment. To set this up go to: Host Group Administration, here you'll see a list of hosts where you can specify your; production, staging and development hosts. An added advantage of this approach is that you can specify users with editor rights only for creating campaigns while more senior users with publishing rights can approve and push to production.
It's possible that you don't have access to your production or development environment or maybe you just like doing things the quick way - yeehaw!
Once you've created your campaign and before clicking "Save & Approve" you need to do a couple of things;
1) Create a segment that requires a value in the URL that's not normally there, I'm using "QA123". It's also worth saving this segment as a future time-saver as it can become frequently used.
2) Once your campaign is approved with your QA parameter targeting you'll need to iterate through all your variations/experiences to validate they're looking and working correctly. This is possible by deleting cookies and refreshing your page in which case you'll want to install a browser plugin to make this easier such as "Remove cookies for site". Another approach is to set your campaign type to "Landing page campaign" - this allows multiple Experiences to be viewed per visit (through targeting) without the need of deleting cookies. You can now set your URL targeting at "Experience" level - for example; "QA123-Control", "QA123-Variant-A". This means you can see your variations/experiences, by going to these URLs; www.example.com?QA123-Control and www.example.com?QA123-Variant.
3) After you've approved your campaign, tested and you're happy, you'll need to go back one more time to remove your QA targeting and "Save & Approve".
Testing your campaigns in Staging
Once you tell Target your Staging and Development hosts, *unapproved* campaigns can be seen in your testing environment. To set this up go to: Host Group Administration, here you'll see a list of hosts where you can specify your; production, staging and development hosts. An added advantage of this approach is that you can specify users with editor rights only for creating campaigns while more senior users with publishing rights can approve and push to production.
Testing your campaigns in Production
It's possible that you don't have access to your production or development environment or maybe you just like doing things the quick way - yeehaw!
Once you've created your campaign and before clicking "Save & Approve" you need to do a couple of things;
1) Create a segment that requires a value in the URL that's not normally there, I'm using "QA123". It's also worth saving this segment as a future time-saver as it can become frequently used.
2) Once your campaign is approved with your QA parameter targeting you'll need to iterate through all your variations/experiences to validate they're looking and working correctly. This is possible by deleting cookies and refreshing your page in which case you'll want to install a browser plugin to make this easier such as "Remove cookies for site". Another approach is to set your campaign type to "Landing page campaign" - this allows multiple Experiences to be viewed per visit (through targeting) without the need of deleting cookies. You can now set your URL targeting at "Experience" level - for example; "QA123-Control", "QA123-Variant-A". This means you can see your variations/experiences, by going to these URLs; www.example.com?QA123-Control and www.example.com?QA123-Variant.
3) After you've approved your campaign, tested and you're happy, you'll need to go back one more time to remove your QA targeting and "Save & Approve".
Summary
Depending on your environment hopefully one of these approaches works, needless to say the most bulletproof stance would be to combine QA in both staging and production. When you have many campaigns running at once you may want to read this post on monitoring and reporting: http://richardhayes.blogspot.co.uk/2014/08/monitoring-your-adobe-target-campaigns.htmlMonitoring your Adobe Target campaigns
When you have tens or hundreds of tests running across your websites you need a way to monitor all your campaigns to be sure everything is okay. Adobe Target makes it very easy to change content and I've experienced situations where "Offers" have been edited in error which has resulted in incorrect or broken "Offers" being displayed, moreover several situations where mboxes have been mistakenly removed resulting in the termination of a test. Unfortunately there's no "out of the box" way to quickly review all your campaigns on one screen. The workaround I'm going to propose requires that you have; SiteCatalyst, Report Builder & the TNT integration Plugin.
Step 1) Create a data block using Report Builder using your Adobe Target Campaign as the dimension, I usually look at the last 7 days.
Step 2) Add orders to your data block and you're nearly done.
Step 3) I now schedule the report so I receive daily and add an Excel "Sparkline" so I can see a trended view of the orders. You can see from the graphic below, this is a pretty basic health-check however it's normally enough to tell you whether something has gone wrong. Hopefully Adobe will look into adding improved reporting options in the future.
Step 1) Create a data block using Report Builder using your Adobe Target Campaign as the dimension, I usually look at the last 7 days.
Step 2) Add orders to your data block and you're nearly done.
Step 3) I now schedule the report so I receive daily and add an Excel "Sparkline" so I can see a trended view of the orders. You can see from the graphic below, this is a pretty basic health-check however it's normally enough to tell you whether something has gone wrong. Hopefully Adobe will look into adding improved reporting options in the future.
(Click to enlarge)
Creating time sensitive offers with Adobe Target
Adding urgency to your campaigns can really move-the-needle, if you need convincing - try reading up on the scarcity principle. In this article I'll show you how to test and report on time sensitive offers using Adobe Target. The below example will show you how to create URGENT offers that expire within 30-90 minutes (this can be adjusted). So without further ado lets get to it!
Creating the 1st Profile Attribute
I've named this Profile Attribute; getOfferExpiryHour and here's what the below code is doing:- Checking to see if the visitor has seen the offer before, if so are they in the allowed time-frame? If not they're set to expired and they've missed the promotion, otherwise we let them through.
- The else clause is doing most of the work - here we have a couple of functions that convert the time from 24hr format (probably nicer to use when outputting in our offer) and another that returns am or pm - again used for copy purposes in our offer.
- The rest is related to time - we're using the visitor's time which is based on their system settings. The visitor will have between 30-90 minutes to complete this offer depending on what time they arrive.
// only run this script with the below mbox
if (mbox.name == 'YourMboxName')
{
// has visitor already seen this offer
var offerExpiryHour = user.getLocal('offerExpiryHour');
// returning visitor that has seen this offer
if(offerExpiryHour)
{
if (profile.browserTime.getHours() >= user.getLocal('offerExpiryHour24') ||
profile.browserTime.getDate() != user.getLocal('offerValidDate'))
{
return "expired";
}
else
{
return offerExpiryHour;
}
}
// vistor's first time seeing the offer
else
{
var hour = null;
var seconds = null;
// is it AM or PM? - used when outputting copy
function amPmDecider(hour)
{
if (hour == 0 || hour == 1 || hour == 2 || hour == 3 || hour == 4 ||
hour == 5 || hour == 6 || hour == 7 || hour == 8 || hour == 9 ||
hour == 10 || hour == 11)
{
return "am";
}
else
{
return "pm";
}
}
// convert to non-24hr format
function convert24Hr(hour)
{
switch(hour)
{
case 13:
return 1;
case 14:
return 2;
case 15:
return 3;
case 16:
return 4;
case 17:
return 5;
case 18:
return 6;
case 19:
return 7;
case 20:
return 8;
case 21:
return 9;
case 22:
return 10;
case 23:
return 11;
case 24:
return 12;
default:
return hour;
}
}
// tnt profile variables
var currentHour = profile.browserTime.getHours ();
var currentMinute = profile.browserTime.getMinutes();
var currentDate = profile.browserTime.getDate ();
// round up time - if user visits at 11:59 we don't want offer to expire at 12:00
var d = new Date(1970, 0, 1, currentHour, currentMinute);
d.setMinutes (d.getMinutes() + 30);
d.setMinutes (0);
// add 1 hour
var offerExpiryHour = d.getHours() + 1;
// store 24hr format for future comparison
user.setLocal('offerExpiryHour24', offerExpiryHour);
// store date of when user was exposed to offer
user.setLocal('offerValidDate', currentDate);
var timeSuffix = amPmDecider(offerExpiryHour);
var offerExpiryHour = convert24Hr(offerExpiryHour);
user.setLocal('offerExpiryHour', offerExpiryHour+timeSuffix);
return offerExpiryHour+timeSuffix;
}
}
Creating the 2nd Profile Attribute
The below Profile Attribute has been named getNumBetween1and2 and is used for identifying whether the visitor has seen the time sensitive experience or the control version - we'll need this later for targeting. I've written about what's going on here in more detail in a previous post.
// target script only for this mbox
if (mbox.name == 'YourMboxName')
{
// has the visitor already been exposed to this script?
var numBetween1and2 = user.getLocal('numBetween1and2');
// yes they have so no need to re-run
if (numBetween1and2)
{
return numBetween1and2;
}
// no they haven't so return a number between 1 & 2
else
{
var x = Math.floor((Math.random()*2)+1);
user.setLocal('numBetween1and2', x);
return x;
}
}
Creating the offer
Now with the above Profile Attributes activated we can create our Offer with added urgency. The getOfferExpiryHour Attribute returns the expiry time, so in our offer we need to reference getOfferExpiryHour which looks something like this:
<h1>Offer Ends ${user.getOfferExpiryHour} today: save 50% on all iPhones!</h1>
<!--
This will look something like this:
Offer Ends 5pm today: save 50% on all iPhones!
-->
Creating the campaign
Our campaign type needs to be: Landing Page Campaign if it's not then when the visitor returns after the expired period s/he will see the limited time offer again which isn't good. Targeting rules for Landing Page Campaigns are reevaluated whereas the more common A/B aren't.In addition we need to create targeting for the returning Control and (expired) Variant visitors, so we can monitor/compare the performance of those that return once the offer has expired. The returning Control experience is just a copy of the default content while the returning Variant experience would be the full-priced / non-promotion offer.
So in total we have 4 experiences:
- The Control - your default content without the urgent offer.
- Variant - your urgent offer.
- Returning control - returning visitors that had previously seen the Control.
- Returning variant - the offer has expired and these are returning visitors that had previously seen the Variant, we would now show them the full price/ non-offer content.
The variant's targeting is the same other than the getNumBetween1and2 profile attribute is checking for 2 instead of 1.
Final reports
So with your targeting and campaign live you'll end up with reports that look like this:And that's it! I've seen some significant lifts when adding a sense of genuine urgency to offers and hopefully you will too.
Targeting operating system versions - Adobe Target
Adobe Target lets you target operating systems out-of-the-box such as; Windows, Mac and Linux, but if you want to target the version you need to create a Profile Attribute and write a bit of code.
The below Profile Attribute has been named getOperatingSystem -
// make sure the browser object is available
if (user.browser)
{
// initialize variables
var OSName="Cannot find OS name";
var OSVer="";
//The below lines of code will find the OS name
if (user.browser.indexOf("Win") !=-1) OSName="Windows";
if (user.browser.indexOf("Mac") !=-1) OSName="MacOS";
if (user.browser.indexOf("X11") !=-1) OSName="UNIX";
if (user.browser.indexOf("Linux")!=-1) OSName="Linux";
if (user.browser.indexOf("Mac OS X 10.4")!=-1) OSVer="Tiger";
if (user.browser.indexOf("Mac OS X 10.5")!=-1) OSVer="Leopard";
if (user.browser.indexOf("Mac OS X 10.6")!=-1) OSVer="Snow Leopard";
if (user.browser.indexOf("NT 2004") !=-1) OSVer="Media Center 2004";
if (user.browser.indexOf("NT 2005") !=-1) OSVer="Media Center 2005";
if (user.browser.indexOf("NT 5.0") !=-1) OSVer="2000";
if (user.browser.indexOf("NT 5.1") !=-1) OSVer="XP";
if (user.browser.indexOf("NT 5.2") !=-1) OSVer="XP";
if (user.browser.indexOf("NT 6.0") !=-1) OSVer="Vista";
if (user.browser.indexOf("NT 6.1") !=-1) OSVer="7";
if (user.browser.indexOf("NT 6.2") !=-1) OSVer="8";
// return OS system and version
return full_os_name=OSName+' '+OSVer;
}
Now in your campaign you can target like this:
Target Experiences based on previously seen content - Adobe Target
Sometimes it's useful to target an Experience based on a previously exposed to Experience, for example - a returning visitor to a landing page that has previously seen control or variant content. So how do you know who has seen which Experience? Assuming an example where we have a Control and Variant Experience, here's how:
1) Create the the following Profile Attribute - which I've named getNumBetween1and2:
3) Now you could create a new Experience for returning visitors that were previously exposed to your Default/Control Experience:
1) Create the the following Profile Attribute - which I've named getNumBetween1and2:
// target script only for this mbox
if (mbox.name == 'YourMboxName')
{
// has the visitor already been exposed to this script?
var numBetween1and2 = user.getLocal('numBetween1and2');
// yes they have so no need to re-run
if (numBetween1and2)
{
return numBetween1and2;
}
// no they haven't so return a number between 1 & 2
else
{
var x = Math.floor((Math.random()*2)+1);
user.setLocal('numBetween1and2', x);
return x;
}
}
2) The above script will run for everyone that's exposed to the mbox: YourMboxName. This means 50% of your visitors will have the number 1 and the other 50% the number 2. With this knowledge and assuming we're distributing the traffic evenly across Experiences then we target the Default and Variant content using these numbers. The below targeting example could be used for targeting your Default/Control Experience:
3) Now you could create a new Experience for returning visitors that were previously exposed to your Default/Control Experience:
Setting and reading cookies inside Adobe Target
Setting
and reading cookies within Adobe Target (Test& Target) is very useful and this
quick post explains how to do it.
Step 1 – first we need to create a profile script attribute. From the main menu: Segments > Profiles > + Create Attribute (script attribute)
Step 2 – Name your Script Attribute, copy the below code and click save:
Step 3 – switch on your script:
Step 4 – now you can use as targeting in your campaigns:
Step 1 – first we need to create a profile script attribute. From the main menu: Segments > Profiles > + Create Attribute (script attribute)
Step 2 – Name your Script Attribute, copy the below code and click save:
// run this script only with this mbox
if (mbox.name == "yourPage.html")
{
// this is how we set cookies in Test& Target
user.setLocal('foo', 'bar');
// this is how we read cookies in Test& Target
var foo = user.getLocal('foo');
// our foo cookie exists
if (foo)
{
return foo;
}
}
Step 3 – switch on your script:
Step 4 – now you can use as targeting in your campaigns:
Subscribe to:
Posts
(
Atom
)



































