A5. Create an rules based personalization activity (experience targeting) - adobe-target/serverside GitHub Wiki

Experience Targeting (XT) is valuable for defining rules that target a specific experience or content to a particular audience. Several rules can be defined in an activity to deliver different content variations to different audiences.

In this exercise, we are going to create an XT activity to show different experiences to users coming from different countries. For example, if you are coming from the UK, you will see the first image and if you are coming from Australia, you will see the second image.

UK Experience serverside-a5-story-1

Australia Experience serverside-a5-story-2

Step 1 : Create the Target Location (mbox) in the react app

1a. Open Brackets and navigate to src > routes > xt.js


1b. In the xt.js file, a1-serverside-xt is the name of the target location. Replace a1 with your unique user number.


1c. Hit Cmd + S to save the file.

Step 2 : Create your XT Activity in the Target UI - Select your location

2a. Go to the Target UI.

2b. Click the blue 'Create Activity' button and then select Experience Targeting.


2c. Select the 'Other/API' option and then select 'No property restrictions'. Click Next


2d. Rename your activity. Prefix your activity with your user number followed by L479. (Eg: K7-L479 XT).


2e. Select or type your location (eg: k7-serverside-xt) in the box. If your location isn't showing up in the dropdown, that is alright.


Step 3 : Create your XT Activity in the Target UI - Add your audience and content

3a. Click on the three small dots and select 'Change Audience'. This will open the Audience library


3b. In the audience library, type 'usa' in the search box. Select the 'L749-XT-USA' audience and click 'Save'.


3c. Click the small arrow after 'Default Content' and select 'Change Image Offer'. This will open the Offer Library.


3d. Select the offer with the title 'L479-XT-USA.png', the image of the liberty statue


3e. Click on 'Add Experience Targeting', repeat the previous 2 steps and similarly add your UK, France and Australia audiences and image offers. After you complete this step, your screen should look like this


Step 4 : Create your XT Activity in the Target UI - Set up your goal

4a. Click 'Next' to go to the Goal & Settings screen. Click 'Next' to go to the Goal & Settings screen. On this screen, select 'Adobe Target' as your reporting source.

Select Viewed an mbox > conversion > order-complete


4b. Click on 'Next', wait a few seconds for the activity to sync. Then click 'Activate'


Step 4 : Restart the node app and verify your AB Test

4a. Open your terminal and press Control + C. The control key is on the bottom left right corner. This will terminate your current app. Your terminal should look like this once you terminate. Look for ^C


4b. Run the app


4b. Go to http://localhost:5000/xt in your browser or refresh the page if you already have it open.

4c. You should now be seeing one of the four experiences. The app randomly sets your country!

Step 5 : Advanced - Set your country in the app

5a. Go to xt.js route and on line 19, change 'chooseCountry()' to a country that you didn't receive. The options are 'usa', 'uk', 'france' and 'australia'.

For example you can set your country to france by making this change on line 19


5b. Hit Ctrl + C and restart the app. You should now be seeing the france experience. Try this for the other countries.