AJS File Builder
Overview
The AJS File Builder allows you to build your pipeline’s Analytics.js files with easy-to-use configuration options. Continue on to learn more about how to access the File Builder and determine how to configure your file for your organization’s use cases. Keep in mind that files must be deployed to a CDN, whether that is your own (preferred) or MetaRouter’s CDN, to be called from your users’ browsers.
Key Benefits
The File Builder includes a user-friendly configuration options that will be applied to your Analytics.js file, such as:
- Integrating consent signals into your event stream via Advanced Consent Enforcement
- Configuring your third-party identity syncs
- Configuring Cross-Domain Identity syncs
Accessing the File Builder
Follow the below steps to access the File Builder:
- Login to your enterprise.metarouter.io account.
- In the lefthand navigation bar, select the Pipelines tab.
- Find the pipeline you’d like to configure, click the three dot symbol on the right-hand side of the pipeline card, and select the Build AJS File option.
Configuring the File Builder
The File Builder contains four sections containing related configuration options.
When you make a change to any of the following settings on the File Builder page, you must redeploy your file in order for your changes to take effect.
File location and settings
These settings tell MetaRouter where your Analytics.js file is hosted, where it should send data to, and allow for other configuration options.
How would you like to host your Analytics.js file?
You have the option of self-hosting your Analytics.js files, allowing MetaRouter to host your file, or deploying the file directly to your website’s code. We highly recommend our customers to self-host files or deploy the file directly to their website as file loading will be less likely to be blocked by ad blockers compared to MetaRouter-hosted files. MetaRouter hosting, on the other hand, can simplify deployments but may result in a loss of data quality due to ad blocking.
Keep in mind that even if you choose to have MetaRouter host the file, you will still need to add the URL where the file will be hosted to the below Analytics.js Hosting URL section. Please ask your MetaRouter Customer Success Manager for this URL.
Analytics.js Hosting URL
This is the URL path where the MetaRouter file is hosted. Before you can provide a URL, you must know the path of the file within your CDN. Learn more about how to host your Analytics.js file here.
If you have asked MetaRouter to host your file, you should reach out to your Customer Success Manager for your Hosting URL.
Ingestion Website URL
The Ingestion Host URL is the API endpoint of the server where MetaRouter is installed. The file will send events to this endpoint so they can be ingested and processed by the MetaRouter platform.
Advanced Settings
File Compression
Enabling File Compression will reduce the size of the Analytics.js file using GZIP compression methodology. This will compress the file by ~75% of original file size. We recommend enabling File Compression to improve page performance.
Activate Enhanced Tracking with HTTP Cookies
By default, MetaRouter stores all identifier values within javascript first-party cookies. This setting allows the anonymousId cookie to be set as a server (HTTP) cookie. Setting HTTP cookies ensures that the anonymousId value stored in the browser will be retained beyond seven days in Safari and Firefox browsers. This setting will store HTTP cookies on all browsers- not just Safari and Firefox.
Keep in mind that only the anonymousId will be available within this cookie. Other identifiers will still be set within a first-party javascript cookie, meaning enhanced tracking will not be available for those identifiers set with first-party javascript cookies.
An additional API call to your MetaRouter cluster is required when HTTP Cookies are activated. This may have a slight impact on page performance.
Please reach out to your MetaRouter Customer Success Manager before activating the HTTP cookies setting to ensure your MetaRouter cluster is configured to handle this setting.
Namespace
You can customize the namespace that MetaRouter uses to call the Analytics.js library and events. By default, this is set to analytics
. You may want to change the namespace if analytics
is already in use on your website.
Storage Prefix
MetaRouter uses a prefix to distinguish the identifiers we set in browser storage (whether in cookies or IndexedDB). The default prefix is _meta
. You can change this prefix to something else, like mr
, that might help you distinguish identifiers set by MetaRouter.
Data Storage Options
MetaRouter supports multiple browser storage mechanisms, each suited to different needs based on data scope, security, and functionality.
- Browser Cookies (scoped to top-level domain)
By default, MetaRouter utilizes browser cookies scoped to the top-level domain. This approach allows cookies to be accessible across all subdomains, facilitating seamless session tracking for users whose activities span multiple areas of your site, such as www.example.com and booking.example.com or shop.example.com. - Browser Cookies (scoped to subdomain)
For use cases that demand higher security, cookies scoped to a specific subdomain may be preferable. These cookies are only accessible within the designated subdomain, such as api.example.com, ensuring that data cannot be shared with other subdomains. This mechanism is particularly useful for isolating data where security is paramount.
_Limitations:_Cookies scoped to the subdomain level do not support session tracking across subdomains. - IndexedDB:
IndexedDB avoids cluttering the browser’s cookie space. It allows for the storage of large amounts of structured data without transmitting it automatically with HTTP requests, making it ideal for applications requiring offline functionality or handling large datasets.
_Limitations:_IndexedDB is a browser storage option that is isolated to the specific domain where it is implemented and does not facilitate session tracking across subdomains.
Migrating from top-level domain cookies to subdomain cookies:
If your organization was previously configured to use subdomain-level cookies, these cookies will no longer be used and may become stale when switching to top-level domain cookies. If transitioning to top-level domain cookies presents challenges due to stale subdomain-level cookies, please contact your MetaRouter Customer Success Manager to discuss migration options.
Safari limits all script-writable storage (including IndexedDB) to a 7-day lifetime. This lifetime resets if a user visits your website within that timeframe.
Compliance Settings
If your organization plans to use, or is using, Advanced Consent Enforcement to handle consent integration, this section provides configuration fields the ensure your file handles your compliance preferences properly.
Consent Policy
This toggle allows users to switch between Explicit and Implicit tracking, which is mandated by the consent regulations in a given region.
Explicit consent means that users must opt-in to tracking via a consent banner prior to any tracking being performed. This is required for the European GDPR law.
Implicit consent means users can be tracked immediately, but they can revoke consent at any point. Once consent is revoked, all tracking is immediately ceased by MetaRouter.
Cookie Name
Within this field, enter the name of the cookie that your Consent Management Platform (CMP) sets. Typically, a user’s consent preferences are typically stored in a first-party cookie set by your CMP. This can usually either be found in your CMP settings or on a browser where the CMP cookie has been set.
Identity Syncs
Within this section, select the vendors you would like the Sync Injector to perform identity syncs with. Different fields are available for configuration within each sync. More in-depth explanations of the available fields for a given sync can be found within integration documentation. A few of the common configurable fields include:
- API Timeout (in milliseconds): Sets the amount of time can lapse before a sync times out.
- Cookie Lifetime (in Days): Sets an expiration time for the ID so the ID can be refreshed with the most recent ID for the user.
Cross-Domain Identity Sync
The Cross-Domain Identity Sync field gives you the ability to maintain a common anonymous user identifier across the domains you own and already have a MetaRouter tag installed. To learn more about this feature, visit our Cross-Domain Identity Sync documentation.
File Overview
Following a successful save and build of your Analytics.js file, you will directed to a File Overview page. This page will allow you to download your Analytics.js file if it didn’t automatically download, copy a version of the Analytics.js snippet that is unique to your organization and pipeline, and view the configuration preferences you indicated during the File Builder setup process.
Updated about 1 month ago