Usecase
Our advanced link script (module) helps you to replace direct links on your website with affiliate links.
Setup
You will need an 'advanced Tag'.
You can find the corresponding article "how to create an advanced tag" here
You have to create a module in your tag configuration first to use our advanced link script. Click on the button 'new module'.
2. Please select the module 'link script'
Now you will see the options to create a new module.
It's important to set a clear name for this module to make it comprehensible for you in the future.
3. Please add the trigger "Global - event - target not equals empty"
The remaining fields are optional.
Our recommendation is to deselect the "Singleton" field for the ContentLink module. This is only needed if your website is an SPA (single-page application) or if you want to run it multiple times.
4. Click on "Create" to complete the configuration.
5. Now you have to integrate the snippet into your code.
Integration
To integrate the script on your website, you will need your advanced Tag:
<script type="text/javascript" charset="utf-8" src="https://ad4m.at/XXXXXXX.js"></script>
Then you only need to request our module with the help of this snippet:
<script type="text/javascript" charset="utf-8">
advancedStoreTag.dispatch('contentLink',{
target: "Id, Class or Element"
});
</script>
It is required to set a target in which area we should search for links to convert.
Possible settings:
target: "body"
Look for all links in the body container
<body>
target: "#blog"
Look for all links in the container with the id blog
<div id="blog"></div>
target: ".container"
Will replace all links in all elements with this class.
<div class="container"></div>
You have multiple options in your dispatch call:
<script type="text/javascript" charset="utf-8">
advancedStoreTag.dispatch('contentLink',{
target: "body",
site: 1,
subId: "MYCAMPAIGN",
pageUrl: "https://test.net"
});
</script>
site
This is your personal siteID. If you set a site in the advanced Tag itself you can remove this attribute.
subId
If you want to track something particular with the help of our advanced link script, feel free to add a specific subId.
pageUrl
It's important to set a pageUrl to define a specific area. This can be helpful when using our advanced tag in an iFrame with the help of Google's tag manager or any other type of special set-up.
blockList
If the script should exclude certain URLs, you can provide them in an array, e.g.: ["https://www.partner.com","http://another.company.com"]
allowList
If you prefer to only monetize specific links, you can provide a list of URLs in an array as well, e.g. : ["https://www.walmart.com","http://another.company.com"]