I need help understanding HubSpot tracking codes. Our website currently uses this implementation:
var hub_id = 789012;
var tracking_ver = "2.00";
var hub_domain = "client-portal.app15.hubspot.com";
document.write(unescape("%3Cscript src='" + document.location.protocol + "//" + hub_domain + "/salog.js.aspx' type='text/javascript'%3E%3C/script%3E"));
Now we received a request to implement this second tracking script:
(function(doc, tag, identifier, interval) {
if (doc.getElementById(identifier)) { return; }
var scriptTag = doc.createElement(tag);
var firstScript = doc.getElementsByTagName(tag)[0];
scriptTag.id = identifier;
scriptTag.src = '//js.hubspot.com/analytics/' + (Math.ceil(new Date()/interval) * interval) + '/789012.js';
firstScript.parentNode.insertBefore(scriptTag, firstScript);
})(document, "script", "hubspot-tracker", 300000);
Are these two scripts serving the same purpose or do they handle different tracking functions? Should both be used together or is one replacing the other?