Sync Injector


This guide is intended to provide an overview of MetaRouter’s Sync Injector and how it interacts with cookies and the critical ID’s they contain. It also describes how the Sync Injector functions within the MetaRouter Platform.

What is the Sync Injector?

The Sync Injector allows for collected client-side events to be enriched with a comprehensive in-event partner identity graph that is stored within the 1st-party context and passed through to server-side processors, and allows for proper attribution within your advertising and marketing tools regardless of technical restrictions of client-side tags and cookies. This is done by executing highly-performant identity syncs with all relevant 3rd-party vendors for a given client while the event is generated within the browser. The Sync Injector also ensures a improvement in performance as it is able to cache attributed identities and diminish the total amount of identity requests that are made while still ensuring that the graph is available within every single event the MetaRouter platform processes.

The Sync Injector centralizes key identifiers and parameters that are typically handled by 3rd-party tags and libraries. While key identifiers and parameters are traditionally stored within disparate cookie spaces, the Sync Injector allows for movement of that information, that is typically handled by 3rd-party tags and libraries, to the 1st-party cookie space and server-side.

Examples of identity information the Sync Injector can extract from the browser include:

  • 3rd-party cookies, such as those placed by advertising platforms like Media Math
  • 2nd-party cookies, such as those placed by social media platforms
  • URL parameters
  • Hashed PII
  • Future global or cohort-based identity solutions, like FLoC or UID 2.0, IDL, which contain IDs that exist only on the browser

How Does the Sync Injector Work?

The Sync Injector is a lightweight Javascript library that is served to the page from a client’s domain, typically along with the MetaRouter Analytics.js library, and handles the extraction, centralization, and forwarding of identity information to the MetaRouter platform.

When a page session is initiated, the Sync Injector loads its library (again, typically along with the MetaRouter Analytics.js library). MetaRouter will scan for IDs that have already been synced by the process outlined below. If MetaRouter cannot find the necessary identifying information that a vendor requires, then MetaRouter will begin executing identity syncs for the vendors that the Sync Injector has been configured for.

The exact method of syncing depends on the capabilities of the particular vendor and how they make cookie values available for access. Usually, the Sync Injector will begin by making a call to a Sync URL, which will return unique identifiers stored in a given Integration Vendor's database that can be provided based upon the cookies MetaRouter identifies as present on the browser. The unique identifier received is then stored in a 1st-party MetaRouter cookie, organized logically alongside other vendor IDs, and is enriched into an Integrations object on every single behavior event sent from the page. These first-party MetaRouter cookies will continue to persist until the cookie is either expired or deleted while also allowing for full customization around desired cookie age depending on your preference.

How Do I Use the Sync Injector?

The Sync Injector is a component of the MetaRouter Analytics.js file that we provide you with and can be enabled upon request. If leveraging the MetaRouter provided Analytics.js file, the Sync Injector will automatically perform all functionality on its own upon initialization.

For non-Analytics.js event streams, the Sync Injector will provide a callback function. The callback executes after identity syncing is complete, and returns a dictionary of identifiers that are available to enrich into the event stream.

Examples: Before and After the Sync Injector

Two scenarios are shown below, which demonstrate how user identity is resolved via standard, third-party tag-based syncs, and MetaRouter syncs.


Before Sync Injector

A user lands on a page where Bing's third-party tracking tag is placed. Bing uses the functionality within this tag to force the browser to fetch an identity to associate with the user visiting. Bing is able to reuse this ID for future identification, however the hosting website is not allowed to access this information.

After Sync Injector

Once a user lands on a page where MetaRouter's Sync Injector is running:

  1. A sync call is made to Bing using an anonymous ID generated locally. Bing correlates this anonymous ID with their identity data and creates a connection between those two.
  2. An HTMLImageElement with the src equal to the request address is appended to the <head> element. The browser loads this image and passes the anonymous ID along with it.
  3. A _meta_bing_beaconFired cookie is stored with the value of true for 365 days, to indicate that a sync call was made and no other syncs should be made until the cookie expires.
  4. If there is a URL parameter called msclkid, this parameter value is stored in the _meta_bing_msclkid cookie for 30 days and added to the integration object as It can now be accessed at a later time.
  5. A random UUID value is generated and stored on the Integration Object as This random mid value is regenerated and saved every time that the library is loaded.
  6. No additional sync requests are made until the _meta_bing_beaconFired cookie expires. The mid value is regenerated when the sync process restarts.
  7. The anonymous ID described at step 1 can be accessed from the object exposed into the window object (or the specified namespace) and can be used to perform tracking calls without using Bing's third-party tag.


Before Sync Injector

A user lands on a page where the Facebook Pixel is running. This "pixel" forces the browser to load a URL that allows Facebook to response to this request and set a cookie within the browser that is used to further identify users but does not enable to website the user is visiting to access these identifiers.

After Sync Injector

A user lands on a page where MetaRouter's Sync Injector is running. Then:

  1. A sync call is made to Facebook by embedding an HTMLImageElement into the webpage. The browser then loads this image and sends a SHA-256 hashed value of the Anonymous ID along with the request value, which Facebook later will use to correlate a user with their identity data.
  2. A _meta_facebookPixel_beaconFired cookie is stored with the value of true for 30 days, to indicate that a sync call was made and no other syncs should occur until the cookie expires.
  3. If a URL parameter called fbclidis present, that URL parameter value is used to generate an fbc value. The resulting fbc is added as a cookie called _meta_facebookPixel_fbc and also to the Integration Bbject as integrations.facebookPixel.fbc. Now, this can be used on later requests to Facebook, without requiring installing the Pixel code.


Sync Injector-Compatible Integrations

The Sync Injector currently is compatible with the below integrations. Keep in mind that we are constantly adding new compatible integrations:

  • Acuity Ads
  • Adobe
  • Amnet
  • Amobee
  • Appsflyer
  • Bing
  • Criteo
  • Facebook Pixel
  • Google Analytics
  • Media Math
  • Merkle
  • Moveable Ink
  • Neustar
  • Pinterest
  • Revjet

MetaRouter is developing support for additional integrations, including:

  • Google Ads
  • Google 360 Suite
  • The Trade Desk