[L3882] Provide Placeholders and Tokens for Tracking or Destinations - Adobe-Marketing-Cloud/aml-summit-lab GitHub Wiki
Provide Placeholders and Tokens for Tracking or Destinations
Objective
For most Acquisition use cases, using static context data is all you need. There are times that you want to provide dynamic context data. This data can be used for tracking purposes or to change the experience for the end-user.
For example, let's say you paid for Google Ads for the a group of search terms. You would like to know what search term is working the best and change the experience for the user depending on what they searched for.
In this exercise, we will show how you can use a technique called token replacement to send in dynamic context data.
Pre-requisites
For this exercise, it is helpful to have a good understanding of how Marketing Links work. To learn more about Marketing Links, complete the lab exercise on creating an acquisition link in Adobe Mobile Services.
Implementation steps
Part 1: Setup a Link Destination
One of the easiest way to illustrate how this works is to use a simple Web Link. The same process can be used to send context data into your app as well though.
-
First, let's create our WebLink. From Adobe Mobile Services, select your app and goto Manage App Settings.
-
Now goto Manage Link Destinations from the top toolbar and click Create New.
-
Add a title and select Web Link as the Link Type.
-
Next, for our Web Link, we are going to choose a url and append ?search={search}. I chose Adobe.com, so my Web Link is as follows:
http://adobe.com?search={search}
Here is what our completed form looks like:
- Save!
Part 2: Simple Token Replacement
Now we are going to show how you can replace the search value directly in the UI.
-
From the left panel, click the Marketing Link Builder link from the Acquisition menu.
-
Create a new Marketing Link.
-
Fill out the form as normal. From the Fallback URL menu, select the Web Link you created in Part 1. Marketing Link Options should be Use Interstitials.
-
Now, click the Add Tracking Context Data button:

-
In the popup, enter search for the Key and what ever you'd like in the Value field:

-
Save and then click Next at the bottom of the form.
-
From the Destination Tree click the
to choose a Destination Type. -
Choose Web Link and then choose the Destination Link that you made in Part 1 and Save.
-
Save your Marketing Link. When it is done saving, click the Copy link button next to your new link and copy the link.
-
Paste the link in a new tab in your browser and hit enter. The url in the browser should correctly show the value you put in for search. The example we entered ended up with the following url:
http://www.adobe.com/?search=secret
Part 3: Dynamic Token Replacement
The url in Part 3 is useful in some use cases. Like let's say we want to know the type of browser the user originated from. We could create our single Destination Link and then create a new Marketing Link for IE and Firefox and Chrome.
But putting in all the possible search values would be impossible. For that, we'd want to replace the token programatically.
-
Start by creating a new Marketing Link. We should follow the exact same steps as in Step 2, but this time, we don't want to add the Context Data. So skip steps 4 & 5.
-
Once your link is created, click the Copy button next to the link and copy the url.
-
Paste the link in a new tab in your browser, but this time, before we hit enter, we are going to append the following on the url:
&ctxsearch=hoverboard -
Now hit enter and note that the url in the browser should have correctly replaced the search token. Mine showed up like this:
http://www.adobe.com/search=hoverboard
Conclusion
The same process we showed here can be used to pass data into your App Links, Deep Links, or Universal Links as well. This can allow you to add additional data to your Analytics or allow you to build custom experiences based on context.