AJS File Builder


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:

Accessing the File Builder

Follow the below steps to access the File Builder:

  1. Login to your enterprise.metarouter.io account.
  2. In the lefthand navigation bar, select the Pipelines tab.
  3. 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.

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.

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.