Start a new topic

Make Web Tracking Script Embed Dynamic

The way I understand it, if any changes are made to a web tracking script, for example adding a new funnel, the script tag version changes and needs to be reembeded into the corresponding site. This seems a bit clunky to me, as we may want to set up funnels for each email campaign (or is there a way to set up one funnel to track all campaigns individually?).


Rather than having a script tag that ends in -v3.js or whatever, wouldn't it be easier to build the script tag and append something unique (like a timestamp) to ensure that it isn't cached? For example:


  

<script>
(function() {
  var jslink = document.createElement('script'); jslink.type = 'text/javascript';
  jslink.src = 'marpost-web-tracking-script-url.js?' + nnew Date().getTime();
  var jss = document.getElementsByTagName('script')[0]; jss.parentNode.insertBefore(jslink, jss);
})();
</script>

  

Or is there an issue that I'm not foreseeing with this type of implementation since it would require the page to load fully before being added and running.


Hi Doug,

We purposely set up the javascript function to allow the browser to cache it for performance reasons.  


We also purposely allow you to make as many changes to the web tracking script as you want without having to redeploy it on your web site.  We will always pull the latest code as final check no matter what.  This allows you to do testing of your customization of our script without having to go through the pain of redeploying the code to your site each time just to verify that your javascript works. (I'm referring to the customization options on the Contact, Page, Funnels, and Orders tab of the Script Builder).


Once you have everything working, you then redeploy the final working version to your web site.


Back to your first question though -- can you explain to me why you want to have separate funnels per email campaign?  What would this information allow you to do?


Best regards,

Manny Ju

Vice President - Product Development

Maropost Marketing Cloud

Thanks for clearing that up Manny. If we don't need to redeploy the code to our site then we're all good! Out of curiosity, if that's the case why does the version change in the script name at all?


Sorry for the confusion, I meant one funnel per email campaign, so never mind that!

Hi Doug,


We're trying to make the best of both worlds with our approach.  For performance reasons, it's always best to rely on the cached javascript code in each users browsers -- hence the versioning in the script.


And at the same time, we wanted to spare the web developer the agonizing hassle of having to redeploy the web tracking script every time he makes a change to the Maropost script -- particularly when he's still testing out the javascript code used in the advanced customization features of our script tag.  It's entirely possible that the script tag will go through several versions before all the customized javascript code is debugged and working properly.  The idea is that you can keep the down-rev version of the script tag on your site until such time as your custom code is working and you're ready to redeploy the final version to your site.


During this time, if we detect that the version of the script tag on the web site is down-rev, we'll send the latest version of the code to the user's browser.  This extra step introduces a slight latency in the web browsing experience.  It's acceptable during the time that the web developer is developing and debugging his customization of the web tracking script.  But certainly not one that should be allowed to exist long term.


Hope this helps clarify.


Now, speaking of wanting one funnel per email campaign.  I'm still curious as to what your intent is by even having one funnel per email campaign.  What is the scenario that you want to track?


Best regards,

Manny Ju

Vice President - Product Development

Maropost Marketing Cloud 



Thanks for the explanation, that is a very cool solution!


In regards to funnels, I might not be fully understanding them and how they are tracked. If we are promoting a specific item on our merchandise site, for example, doesn't the funnel's start page need to be updated when we change the item in a different email campaign?


Being a sport's team, our company's situation is a little unique in that in any given email we're promoting ticket purchases, merchandise items, and / or fan-related content. As far as I'm aware, we're unable to embed the maropost script on our ticketing funnel due to Ticketmaster's policies, but we do have control over our merchandise site (warriorsteamstore.com) and would like to get to a point where we can better track how our campaigns perform with it.

Login or Signup to post a comment