Xandr
What Is Xandr?
Xandr is Microsoft’s advertising technology platform for audience segmentation, retargeting, and conversion measurement. Xandr Universal Pixel helps advertisers collect website and app activity for audience creation and campaign reporting. This starter kit sends supported commerce and funnel events to Xandr using Universal Pixel request parameters. The integration uses the Xandr sync to retrieve the Xandr user identifier needed for event matching.
Product Type: Advertising
Integration Type: Starter Kit & ID Sync
Event Source Type: Web and/or Mobile Browser
Event Scope: Full-Funnel Events
Capabilities
- Sends Universal Pixel events to Xandr for audience and conversion workflows
- Supports page, product, checkout, payment, and purchase events
- Maps product identifiers, names, categories, currencies, and values where available
- Uses Xandr synced identifiers for user matching
- Supports consent-aware Xandr sync behavior for regulated regions
Considerations
- The Xandr UID must be present and valid for events to be sent
- Events without a resolved Xandr UID are filtered out before delivery
- Microsoft requires consent signals for applicable users in the EEA, UK, and Switzerland
- Missing consent signals may affect audience and conversion processing in regulated regions
- Event parameter values should be kept short because Xandr enforces parameter length limits
- URLs and referrers may exceed Xandr parameter limits and should be reviewed before launch
- Product names are shortened to 100 characters for checkout and purchase events
- In our testing, requests above ~20,000 characters in the URL began to fail. While this isn’t a formally documented limit, it may be a practical constraint to consider when using this integration.
- All values must be URL-encoded and arrays pipe-delimited.
- One request per event; batching not supported.
- Complex lists, such as product lists, must be pipe-delimited.
Limitations
- Each event parameter value has a maximum length of 100 characters
- Events cannot be sent when the Xandr UID is missing or set to
0 - The integration does not support batching multiple events into a single request
Identity Sync
-
Sync Available: Yes
-
Required for Starter Kit: Yes
-
Prerequisites: N/A
-
Documentation: See Additional Xandr Sync Documentation
Sync Details
- Retrieves the Xandr UID used for event matching
- Stores the UID and formatted cookie value for server-side event delivery
- Supports retry behavior when the sync attempt fails
- Includes consent-aware behavior for supported privacy frameworks
Starter Kit Setup Guide
1. Deploy the Xandr Sync
- To collect the sync values, you must implement a Xandr ID sync. Refer to the following documentation to complete the setup: Xandr – ID Sync Guide.
2. Gather Credentials
PIXEL_ID— Create or locate the Universal Pixel ID in Xandr.
3. Add a Xandr Integration
- From the integration library, add a Xandr integration. Then, fill out the Connection Parameters:
| Connection Parameter | Description |
|---|---|
PIXEL_ID | Xandr Universal Pixel identifier used to route events. |
4. Configure Event Mapping
- MetaRouter provides all of the event mappings that Xandr integrations typically require. You may add custom events, parameters, or mappings in accordance with Xandr’s API documentation.
5. Deploy to Pipeline
-
In the Pipelines tab, add your Xandr integration.
-
Select the correct integration revision
-
Click Add Integration to finalize deployment.
Event Mappings
Global
Global mappings will be applied to all events. If your parameter names do not match the Expected Inputs provided, you will need to overwrite the Inputs provided with your own.
| Output Key | Description | Expected Input |
|---|---|---|
pi Required | String: Xandr Universal Pixel ID. | $$PIXEL_ID$$ |
script | String: Indicates non-script pixel delivery. | Enrichment – hardcoded value '0' |
et | Integer: Event timestamp in milliseconds. | Expression – generate timestamp in milliseconds |
u | String: Page URL associated with the event. | context.page.url |
r | String: Referrer URL associated with the event. | context.page.referrer |
Event Specific
Page
| Output Key | Description | Expected Input |
|---|---|---|
e | String: Xandr page event name based on page path. | Expression – return 'LandingPage' for /, otherwise 'PageView' |
Product Viewed
| Output Key | Description | Expected Input |
|---|---|---|
e | String: Xandr item view event name. | Enrichment – hardcoded value 'ItemView' |
ii | String: Product identifier. | properties.product_id |
in | String: Product name. | properties.name |
itp | String: Product category. | properties.category |
c | String: Uppercased currency code. | properties.currency |
Product Added
| Output Key | Description | Expected Input |
|---|---|---|
e | String: Xandr add to cart event name. | Enrichment – hardcoded value 'AddToCart' |
ii | String: Product identifier. | properties.product_id |
in | String: Product name. | properties.name |
itp | String: Product category. | properties.category |
c | String: Currency code. | properties.currency |
va | String: Product value calculated from price and quantity. | Expression – multiply properties.price by properties.quantity |
Checkout Started
| Output Key | Description | Expected Input |
|---|---|---|
e | String: Xandr checkout event name. | Enrichment – hardcoded value 'InitiateCheckout' |
ii | String: Comma-separated product identifiers. | Expression – join product_id values from properties.products |
in | String: Comma-separated product names shortened to 100 characters each. | Expression – join shortened name values from properties.products |
itp | String: Comma-separated product categories. | Expression – join category values from properties.products |
va | String: Checkout value. | properties.value |
c | String: Uppercased currency code. | properties.currency |
Payment Info Entered
| Output Key | Description | Expected Input |
|---|---|---|
e | String: Xandr payment step event name. | Enrichment – hardcoded value 'AddPaymentInfo' |
Order Completed
| Output Key | Description | Expected Input |
|---|---|---|
e | String: Xandr purchase event name. | Enrichment – hardcoded value 'Purchase' |
ii | String: Comma-separated product identifiers. | Expression – join product_id values from properties.products |
in | String: Comma-separated product names shortened to 100 characters each. | Expression – join shortened name values from properties.products |
itp | String: Comma-separated product categories. | Expression – join category values from properties.products |
va | String: Purchase value. | properties.total |
c | String: Uppercased currency code. | properties.currency |
Required & Recommended Identifiers
These identifiers must be mapped to Xandr in order for successful user matching to occur. Without these IDs, any events sent to Xandr may not be accurately reflected in reporting.
| Attribute | Example | Sync Injector Required? |
|---|---|---|
context.providers.xandr.uid Required | abc-123 | Yes |
context.providers.xandr.uid2 Required | uuid2=abc-123 | Yes |
PIXEL_ID Required | my-pixel-id | No |
Integration Validation
-
Trigger a test event through the Xandr integration.
-
In Xandr, review Universal Pixel activity for the associated pixel.
-
Confirm expected event activity is visible for the tested pixel.
-
Confirm the expected event parameters and values are present where available.
-
Validate that no consent, authentication, or request-size issues are preventing delivery.
Additional Xandr Documentation
- https://learn.microsoft.com/en-us/xandr/invest/universal-pixel-basic-implementation
- https://learn.microsoft.com/en-us/xandr/curate/the-universal-pixel
- https://learn.microsoft.com/en-us/xandr/curate/universal-pixel-code-structure
- https://learn.microsoft.com/en-us/xandr/monetize/universal-pixel-object-limits
- https://learn.microsoft.com/en-us/xandr/invest/set-up-consent-mode-in-universal-pixel
Updated 19 days ago