Tracking consent

This page explains how to set up your Constructor integration for shoppers who have not given, or have withdrawn, the consent your business requires for Constructor's behavioral tracking and personalization. Your business decides whether consent is required and how to classify Constructor in its consent framework.

Constructor receives two types of requests:

  1. Product discovery requests retrieve results for search, autocomplete, browse and recommendations.
  2. Behavioral tracking requests send events such as product views, clicks, add-to-cart actions, and purchases.

The two request types are independent, so configure consent handling for both. For how Constructor assigns and stores its identifiers, see Identification parameters and How are user and session identities handled by Constructor?

Product discovery requests

Product discovery requests can be made through a client-side library, mobile SDK, server-side library, or direct API integration. The consent outcome should be the same across methods: when the required consent is absent or withdrawn, omit the i and ui parameters from browser and app requests. In a backend integration, do not read or set the ConstructorioID_ cookies, omit ui, and send a per-visit i that your server creates and keeps only in its own session.

Because no behavioral events are sent for that shopper, Constructor will likely treat that shopper's requests as non-human traffic in any integration. They can get slower or stale results, and they can be rejected, occasionally or permanently.

Constructor's JavaScript client and mobile SDKs always create and send i, so for these shoppers, request results through your servers instead. See JavaScript client and Mobile SDKs below.

Request parameters

Each parameter below is required unless its description says otherwise. For full definitions, see Required parameters and the API Reference.

FieldPurpose and consent-mode guidance
API keyIdentifies the Constructor index.
iClient identifier. Omit from browser and app requests when the required consent is absent or withdrawn. In a backend integration, send a per-visit identifier your server creates and keeps only in its own session; do not substitute any other identifier. Constructor uses that identifier to manage traffic, assign A/B test groups, count zero-result searches, generate related searches and count daily requests and distinct users. Results are not personalized based on the shopper's behavioral actions. See Identification parameters.
uiOptional, but expected for every logged-in shopper who has consented. Obfuscated identifier for a logged-in user, such as a hashed account ID. Send only for logged-in users. Omit when the required consent is absent or withdrawn, even if the shopper is logged in. See Omnichannel personalization for how to obfuscate the ID.
sSession identifier. Always send it, including when consent is absent or withdrawn. If no stored value is available, send a fixed integer such as 1.
IP addressReceived with the request regardless of tracking consent. For backend integrations, forward the shopper's IP in X-Forwarded-For.
User-AgentIdentifies the originating browser or app. Backend integrations should forward the shopper's value.
x-cnstrc-tokenConstructor-issued security token for backend requests only. Keep it server-side. See Backend integration options.
cIdentifies the integration. Specify it for direct API integrations; client libraries set it, so do not send it yourself when using one.
origin_referrer and _dtRequest context and timestamp. See Direct to API tracking.

IP and location: Constructor requires IP addresses with every request for security and operations and derives approximate location (country, region, city and time zone) from them. Location can also inform geographic merchandising and ranking, including when behavioral tracking consent has not been given. See Required parameters.

Behavioral tracking requests

When the required consent is absent or withdrawn, do not send behavioral events to Constructor through any integration method or tracking path.

For websites, Constructor recommends the beacon together with frontend markup, which includes:

  • Adding attributes to existing HTML elements. See Data-driven event tracking.
  • Adding or updating JSON script tags.
  • Adding or updating values on the browser's window object. See Logged in user ID in Data-driven event tracking.

The steps for each tracking method follow.

Beacon

When the required consent is absent or withdrawn:

You can also set the ConstructorioDisableBeaconTracking=true cookie as an extra safeguard against the beacon sending events. The cookie does not stop identifiers from being stored.

JavaScript client

The client-side library has a tracker module for sending events as behavioral tracking requests. It can also manage identifiers independently of the beacon. The browser client always creates i and sends it with every search, browse, autocomplete and recommendations request, and no setting turns this off. See How are user and session identities handled by Constructor?

When the required consent is absent or withdrawn:

  • Gate all tracker calls on consent, including purchase events and events triggered by any UI components.
  • On withdrawal, stop using the client for that shopper and clear any identifiers it has already stored.
  • Do not create the client for a shopper who has not consented. Request that shopper's results through your servers instead, with a per-visit i, as described in Backend integration options.

Mobile SDKs

The iOS and Android SDKs can support tracking and manage identifiers. A mobile app may also use webviews with a separate web tracking integration. See Native apps in Behavioral tracking.

When the required consent is absent or withdrawn:

  • Gate SDK tracking calls and apply the same rule to any webview tracking.
  • On withdrawal, stop using the SDK for that shopper, delete the identifiers it stored, and do not start it again unless the shopper consents again.
  • Do not initialize the SDK for a shopper who has not consented: both SDKs create and store i when initialized and send it with every request. Request results for that shopper through your servers, and initialize the SDK only after consent.

For a React Native app that uses the JavaScript client in DOM-less mode, do not create or store a client ID and do not create the client until the shopper consents. On withdrawal, stop using the client and delete the stored client ID.

Server-side libraries and direct API

Sending behavioral events from your servers or directly to the API requires Constructor's written approval. This integration sends events from your infrastructure instead of the beacon. The Node library includes a tracker module. See Direct to API tracking and Backend integration options.

Propagate the shopper's consent state to every service that can create or send events.

When the required consent is absent or withdrawn:

  • Do not call tracker methods or send behavioral events directly to the API.
  • On withdrawal, stop sending events for that shopper and make sure queued events are not sent.
  • Constructor's server libraries do not queue or retry events. If your own services queue or retry events, drop the pending ones for that shopper.

Validate the implementation

Test before the shopper makes a choice, after they deny consent and after they withdraw it. In each case:

  • Inspect product discovery requests to confirm i and ui are absent from browser and app requests, and that backend requests carry no ui and only a per-visit i kept in your server session.
  • Confirm no behavioral events are sent.
  • Inspect browser and app storage to confirm no keys starting with ConstructorioID_ or containing _constructorio_ remain.
  • Confirm product discovery still works as expected, and check that s, the IP address, the User-Agent, and, for backend integrations, the X-Forwarded-For and x-cnstrc-token headers are sent.

Repeat for each site, app, webview, and integration path.

If more granular details are needed, see Setting up shopper consent in Data-driven event tracking or contact Constructor.


Did this page help you?