• In Salesforce Marketing Cloud, create a new Cloud Page.

  • In the html header of the Cloud Page, place the GTM code snippet (the GTM code that contains the SalesWings tracking script).

Example:

<!-- Google Tag Manager --><script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-XXXXXX');</script><!-- End Google Tag Manager -->

  • In the html footer of the Cloud Page, please add the following Javascript code snippet:

<!-- Redirect Script -->
<script>
function getUrlParameter(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
};
var redirect_url = getUrlParameter('url')
setTimeout(function(){
window.location.href = redirect_url;
}, 500); //redirect time, in miliseconds
</script>
<!-- End Redirect Script -->

  • In the email, please place the following url in the href tag of the link that needs to be tracked:

https://subdomain.domain.com/sw-redirect?url=%%=UrlEncode(‘<insert_url_to_track_here>’)=%%

Example: https://subdomain.domain.com/sw-redirect?url=%%=UrlEncode(‘https://www.google.ca’)=%%

📍 IMPORTANT NOTES:

  • The code will not track if the user has javascript disabled in their browser

  • Every Cloud Page view counts as 1 SuperMessage towards the Salesforce Marketing Cloud SuperMessage limit (limit different for each Customer)

Did this answer your question?