Tag Management Systems
If adding Marketo Measure JavaScript via hardcoding is not possible, another option is to add the Marketo Measure script using a Tag Management System such as Google Tag Manager (GTM) or Tealium.
Using tag management systems to deploy Marketo Measure JS can result in a potential 5-10% data loss due to script load time latency. Essentially, if the tag management tool does not load quickly enough, Marketo Measure JS also cannot load quickly enough and could lose first referrer information.
A common practice is to deploy Marketo Measure JS via a tag management tool until timing/resourcing is better to move to hardcoding.
To add Marketo Measure script through a tag management solution, you need to create a tag and add our JavaScript within it. Apply this tag to all the pages on your website that you want tracked.
Marketo Measure recommends that any page view should cause the tag to fire. Also, it’s best to give Marketo Measure the highest priority in the firing order and make sure that there are no synchronous scripts in front of the Marketo Measure tag to ensure the highest data quality.
More information can be found here.
Additional Considerations
Marketo Measure JavaScript is domain-based so it is automatically able to handle any subdomains as long as the JavaScript is on the pages and the root domain is the same as the domain used to create the Marketo Measure account.
However, if you are using any separate or international domains, be sure to let your Marketo Measure Consultant know. The domains must be manually added to your account on the Marketo Measure end so that Marketo Measure knows to tie the additional domains’ data to your account. So, send any separate/international domains to your Marketo Measure Consultant.
If you use any third-party pages, have a conversation about your use case with your Marketo Measure Consultant. In general, you will want to know if you can add a custom version of Marketo Measure JavaScript to track those pages if appropriate. If this is not possible, tracking via CRM Campaign touchpoints will be explored with your Marketo Measure Consultant.
Do you have any forms that should NOT be tracked by Marketo Measure since they don’t necessarily make sense for attribution (for example, unsubscribe forms, customer logins, and so on,)? If so, you will want to add the exclude code in this article to each form
Do you have any non-secure pages? You should secure them as navigating between a secure/non-secure page breaks the tracking session.
Be sure to have a conversation with your web team so they know Marketo Measure JavaScript should always be on the appropriate web properties. If new pages/forms/sites are introduced, make sure deploying Marketo Measure JavaScript is part of the protocol.
If a Web Application Firewall (WAF) warning is triggered during the JavaScript setup, users can either disable that WAF rule or allowlist the cookies, as the below example: