Iubenda¶
Iubenda is a service for generating, maintaining, and keeping legal content — privacy policies, cookie policies, and consent banners — up to date on websites and apps. It is designed so that anyone running a website can produce compliant legal documents without legal expertise.
Under the GDPR, visitors from several European countries must actively consent before their actions can be tracked for advertising or measurement purposes. If they accept, tracking can proceed; if they decline or have not yet expressed a preference, it must not.
The module integrates with Iubenda so that all Facebook Pixel and Conversions API tracking is automatically gated on the customer's cookie consent. When enabled, no event is sent until consent for Purpose #4 — Measurement has been granted.

Enabling the integration¶
Toggle Iubenda to ON and save. The module will immediately start reading Iubenda consent cookies on every page.
Purpose #4 — Measurement¶
The module specifically checks for consent to Purpose #4 in the IAB framework, which covers:
- Statistics
- Beta testing
- Content and functionality performance tests (A/B testing)
- Heat mapping and session recording
- Management of data collection and online surveys
How consent is checked¶
When the integration is enabled, the module's frontend script looks for a cookie whose name starts with _iub_cs (granular-consent variants are excluded). It parses the cookie JSON and reads purposes["4"].
| State | Behaviour |
|---|---|
Cookie found, purpose 4 true |
Events fire normally. |
Cookie found, purpose 4 false |
Events are blocked; the revoke endpoint is called. |
| No cookie found (first visit) | Events are held until the customer expresses a preference — see Tracking first consent. |
When the integration is disabled, the module always fires events regardless of any consent cookies.
Tracking first consent¶
When a visitor lands on the store for the first time and no Iubenda consent cookie exists yet, the module exposes a global JavaScript method — FbpLibrary.enableFBPixel() — and waits. The pixel will not initialise until this method is called.
To trigger pixel initialisation the moment the customer accepts the policy, add the following callback to your Iubenda csConfiguration:
var _iub = _iub || [];
_iub.csConfiguration = {
// ... your existing configuration ...
callback: {
onPreferenceFirstExpressed: function(preferences) {
FbpLibrary.enableFBPixel();
}
}
};
onPreferenceFirstExpressed fires as soon as the customer makes their first consent choice. Calling FbpLibrary.enableFBPixel() at that point starts the pixel and begins sending events for that page visit. If the method is called more than once, subsequent calls are silently ignored.
Note
This callback only needs to handle the acceptance case. If the customer declines, no action is required — the module will not fire any events.
Consent revocation¶
If a customer revokes consent during their session, the frontend script calls the revoke endpoint (?action=revoke), which removes all pending browser-side events for that visitor from the queue. Server-side (Conversions API) events already dispatched cannot be recalled, but no further events will be queued for that session.
Note
This integration only reads Iubenda cookies. It does not configure Iubenda, manage consent banners, or write consent records. You must have Iubenda installed and working on your store independently.