How to integrate via Javascript
Integrating the campaign via Javascript
Pages
Secure page you must leave it blank, if you enter any value, Cloakup will ignore it.
Offer page you must insert the link to the page that will be displayed to the user.
The cloaking method, you can choose between:
- Show content: We will display the page content to the visitor in an iframe. If you use this method, we recommend that all links on your site use the target="_blank" attribute. You can paste the script below in the head of your page to do this automatically.
<script>
document.addEventListener("DOMContentLoaded", function() {
const links = document.querySelectorAll('a');
links.forEach(function(link) {
link.setAttribute('target', '_blank');
});
});
</script>
- Redirect: We will redirect the visitor to the offer page URL.
Filters
In the integration you have the option to activate the Domain filter, where you can define which domains can use the script for this campaign. If activated, you must enter the allowed domains.
Installation
After creating a campaign, we will provide a script, which you must copy and add to the header (<head>) of the secure page to carry out the integration.
After installation, you will need to use your secure page link to advertise, and Cloakup will filter the traffic and display the offer page for real visitors and the secure page for filtered visitors.
After installation, we recommend that you do a test to check if the integration was done correctly. You can do this by accessing the secure page and checking if a new request appears in the Campaigns/Requests tab.
Updated on: 04/09/2024
Thank you!