Deploying Your AJS Tracking File
Overview
When you build a tracking javascript (AJS) file with MetaRouter, you will need to deploy it into a Content Distribution Network (CDN), which will allow it to be retrieved by your MetaRouter snippet anytime it loads within your users’ browsers. Typically, we recommend installing the file within your own CDN, as you will see enhanced data collection in environments where ad blockers can detect javascript loaded from third-party sources.
MetaRouter-Hosted vs. Self-Hosted Files
MetaRouter provides two AJS file hosting methods: Self-Hosted and MetaRouter-Hosted. Self-hosted AJS files lessen the effect of ad blockers as they are loaded from your own CDN and therefore aren’t counted as potential third-party trackers). Furthermore, they allow your organization to control when and how new javascript is installed on your website. They do require slightly additional implementation effort, as you will need to coordinate file changes with individual(s) who are able to access and update your website’s CDN.
MetaRouter-Hosted files provide an easier implementation pathway, as our team will simply install the AJS file on our own CDN. This eliminates the need to replace AJS files after every file change, but could result in tracking blocking by ad blockers that have tagged the MetaRouter CDN as a potential third-party tracker. Keep in mind, you will still have insight into the javascript that is deployed to your website via the AJS File Builder.
We strongly recommend that customers self-host their AJS files where possible so they can take advantage of the benefits of first-party file hosting.
How to Deploy Your AJS File
The following instructions will walk you through how to deploy your file within a CDN.
Download Your AJS File
The first step towards deploying your file is to first build and download your file. Follow the instructions within the File Builder documentation to build your file. Once finished with the file building process, your file should automatically download to your device.
MetaRouter-Hosted Deployment
If deploying a MetaRouter-Hosted file, simply fill out a request at support.metarouter.io. Our support team will follow up with you once your file is deployed.
Self-Hosted Deployment
The steps required to host your AJS file within your CDN will vary depending on the CDN your organization uses. If you are unsure of or do not have access to your website’s CDN, you will need to contact your website administrator and ask them to deploy your file.
These docs contain more information about how to host files within some of the most popular CDNs:
When testing file changes in your CDN, ensure that you have cleared your CDN’s cache.
Additional Considerations
How often will I need to update my AJS file?
Once deployed, you will need to update your AJS file anytime you make a change to any section contained within the File Builder. You do not need to update your AJS file when creating, editing or uploading integration playbooks.
Updated 8 months ago