Skip to content
Product Documentation

Audience Targeting: Developer guide

Audience Targeting is an integrated, server-side targeting tool that allows users to easily build audiences leveraging out-of-the-box criteria and seamlessly curate and deploy tailored digital experiences. For more information on this feature, please see Arc XP’s Audience Targeting.

Audience Targeting can work with no developer work required when targeting by Country and Device. (When using the Cookie targeting criteria, developers are responsible for adding any necessary cookies to pages).

After Audience Targeting capability is provisioned to your organization, your staff can create variants in PageBuilder Editor UI, configure segments in Audience Manager under Delivery without needing to change your code. The details in this Developer document is completely optional and intended for more advanced use cases.

Another important point to note here is; since Audience Targeting utilizes Edge Network Computing when determining a user’s segmentation (where the “decision” mechanism works closer to your user’s geographic region), it is tightly coupled with Arc XP CDN therefore it is not possible to emulate this in local development environment. Audience targeting can be used and tested on Arc XP environments.

How does Arc XP determine the Audience for my reader?

Arc XP has developed a personalization solution in collaboration with our CDN partner to provide unique end-user customizations. The criteria for customizations are applied to the incoming traffic request at the CDN edge server and based on the criteria (cookie, device, and country location) that match the audience configuration (through the Audience Targeting UI) then, personalization can be applied. The criteria are applied to the end-user request based on request headers.

For example, if you have a customized page for users accessing from France, a reader requesting this page will have the closest CDN edge server rendering this page based on the value of the geo-location request header. Then these geo-location criteria can be configured to an audience, can be customized in PageBuilder to serve a different variant of the same page, i.e: HomepageEU vs HomepageUS

How to detect which Audience is used in a given page render

Developers have access to the Audience associated with a given page render through the segmentID property. This value corresponds to the name of the Audience associated with that page variant in PageBuilder.

Access Segment ID in Content Sources using Query Parameters

Segment IDs are sent in the segmentID query parameter for every content source. This value will always be either a string or null.

/**
* A simple content source that retrieves and returns the Segment ID.
*/
const fetch = ({ segmentID }) => ({ segmentID });
export default { fetch };

Access Segment ID in Rendered Components using Fusion Context

Segment IDs may be accessed in rendered components using the Fusion Context. This value will always be either a string or null.

import React from "react";
import { useFusionContext } from "fusion:context"
export default () => {
const { segmentID } = useFusionContext();
return (<div>Segment ID: {segmentID ?? "none"}</div>)
}