Connect your own consent tool
Lumexio records where each order comes from (Google Ads, Meta, newsletter…) only for visitors who accepted advertising cookies. If your consent tool does not send Google Consent Mode v2, tell Lumexio the visitor’s choice yourself: one line of JavaScript, about 10 minutes.
In short
- Module 1.10.0 or later
- Accepted → push “granted”
- Refused → push “denied”
- Nothing sent → nothing recorded
Which option is for you?
Choose it per shop in the module: Modules › Lumexio › Configure › “Visitor consent”.
Google Consent Mode v2
Your consent tool already sends Google Consent Mode v2 (most do: Axeptio, Didomi, Cookiebot, OneTrust, the PrestaShop “Google Consent Mode” modules…). Nothing to do: Lumexio reads it directly.
My own consent tool
Your tool does not send Consent Mode v2, you have turned it off, or you built your own banner. Your code tells Lumexio the visitor’s choice through window.lumexioConsent.
Set it up in 3 steps
-
1
Switch the module
In your PrestaShop back office: Modules › Module Manager › Lumexio › Configure. In “Visitor consent”, choose “My own consent tool”, tick the confirmation box, then Save. Repeat for each shop in a multistore.
-
2
Send the visitor’s choice
When the visitor accepts advertising cookies, run the “granted” line. When they refuse or withdraw, run the “denied” line. Run it again on every page once the choice is known: most consent tools do this for you through their callbacks (see below).
-
3
Check and place a test order
Follow the checklist at the bottom of this page. Then place a test order after landing on your shop with ?utm_source=test: its source shows in Lumexio’s Acquisition page after the next sync.
The code
The order of loading does not matter: values pushed before the Lumexio script loads are read as soon as it does. Only the last value counts.
window.lumexioConsent = window.lumexioConsent || [];
// the visitor accepted advertising cookies
window.lumexioConsent.push('granted');
// the visitor refused, or withdrew their consent
window.lumexioConsent.push('denied');
Ready-made code for your consent tool
Pick your tool. Each snippet reads the visitor’s choice and sends it to Lumexio on every page, including when the visitor changes their mind.
In your Axeptio project, add a cookie (vendor) named “lumexio” to your advertising step, then publish. Add this code to every page:
window._axcb = window._axcb || [];
window._axcb.push(function (axeptio) {
axeptio.on('cookies:complete', function (choices) {
window.lumexioConsent = window.lumexioConsent || [];
window.lumexioConsent.push(choices.lumexio ? 'granted' : 'denied');
});
});
The key (choices.lumexio) must match the vendor name you set in Axeptio.
In the Didomi console, create a custom vendor “Lumexio” and add it to your advertising purpose, then publish. Copy its ID (it starts with “c:”) and add this code to every page:
function sendConsentToLumexio(Didomi) {
var vendor = Didomi.getCurrentUserStatus().vendors['c:lumexio-XXXXXXXX'];
window.lumexioConsent = window.lumexioConsent || [];
window.lumexioConsent.push(vendor && vendor.enabled ? 'granted' : 'denied');
}
window.didomiOnReady = window.didomiOnReady || [];
window.didomiOnReady.push(sendConsentToLumexio);
window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
event: 'consent.changed',
listener: function () {
sendConsentToLumexio(window.Didomi);
}
});
Replace c:lumexio-XXXXXXXX with your vendor ID. You can check it in your browser console with Didomi.getCurrentUserStatus().vendors.
Lumexio follows the “Targeting cookies” category (C0004 by default). OneTrust calls OptanonWrapper on every page and after every change: put the code in the OptanonWrapper function of your OneTrust snippet, in your page’s <head>.
function OptanonWrapper() {
// …your existing OptanonWrapper code, if any…
var groups = window.OnetrustActiveGroups || '';
window.lumexioConsent = window.lumexioConsent || [];
window.lumexioConsent.push(groups.indexOf(',C0004,') !== -1 ? 'granted' : 'denied');
}
If your targeting category has another ID, replace C0004 (Cookie Consent › Categorizations in OneTrust).
Declare Lumexio as a tarteaucitron service, after tarteaucitron.init():
tarteaucitron.services.lumexio = {
key: 'lumexio',
type: 'ads',
name: 'Lumexio',
uri: 'https://lumexio.tech/privacy',
needConsent: true,
cookies: ['lumexio_attr'],
js: function () {
'use strict';
(window.lumexioConsent = window.lumexioConsent || []).push('granted');
},
fallback: function () {
'use strict';
(window.lumexioConsent = window.lumexioConsent || []).push('denied');
}
};
(tarteaucitron.job = tarteaucitron.job || []).push('lumexio');
Lumexio then appears in the tarteaucitron panel, in the advertising group, and the visitor can accept or refuse it like any other service.
If your consent tool sends its own events to Google Tag Manager, create two “Custom HTML” tags:
<script>
window.lumexioConsent = window.lumexioConsent || [];
window.lumexioConsent.push('granted');
</script>
<script>
window.lumexioConsent = window.lumexioConsent || [];
window.lumexioConsent.push('denied');
</script>
Both tags must fire on every page where the choice is known, not only when the banner is clicked.
If you built your own banner, call Lumexio where you store the choice, and once on every page load:
function sendConsentToLumexio(accepted) {
window.lumexioConsent = window.lumexioConsent || [];
window.lumexioConsent.push(accepted ? 'granted' : 'denied');
}
// When the visitor clicks "Accept" or "Refuse" in your banner:
sendConsentToLumexio(true); // or false
// On every page load, once the visitor has chosen:
sendConsentToLumexio(hasAcceptedAdvertising());
Replace hasAcceptedAdvertising() with however your banner remembers the visitor’s choice.
Where to paste the code on PrestaShop
In your consent tool
Many tools have a “custom script” or “callback” field that runs on every page. It is the simplest place.
In Google Tag Manager
A “Custom HTML” tag fired on all pages. No theme change, no developer needed.
In your theme
Add it to themes/your-theme/assets/js/custom.js (loaded on every page by default themes), then clear the cache in Advanced Parameters › Performance. In a .tpl file, wrap the script in {literal}…{/literal}.
Check it works
Open your shop in a private window, with ?utm_source=test at the end of the address, then open the browser console (F12).
- 1 Accept advertising cookies in your banner.
- 2 Type window.lumexioConsent in the console: the last value is “granted”.
- 3 In Application (Chrome) or Storage (Firefox) › Cookies, a lumexio_attr cookie is present.
- 4 Refuse or withdraw your consent: the last value becomes “denied” and the lumexio_attr cookie is deleted.
- 5 Nothing happens? Make sure the module is on “My own consent tool” and that its version is 1.10.0 or later.
Good to know
- Only after a real consent
- Send “granted” only once the visitor has accepted advertising cookies. As the site owner, you remain responsible for collecting that consent: the module stores nothing until it receives it.
- What Lumexio stores
- A first-party lumexio_attr cookie (30 days) with the visit’s source, medium, campaign, referring site, click ID type and landing page. No visitor identifier, no IP address, nothing shared with ad platforms.
- Withdrawal is immediate
- “denied” deletes the cookie at once. Orders placed afterwards carry no source.
- List it in your cookie policy
- Declare lumexio_attr in your consent tool and cookie policy: purpose “measuring the performance of advertising campaigns”, duration 30 days.
Need a hand?
Send us your consent tool’s name and your shop’s address: we will tell you exactly what to paste.
Contact us