Knowledge base
1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!
Ticketing: Add a Meta / Google tracker to the store
This guide provides the list of triggers to use for your Google Tags and Meta (Facebook) pixel trackers in your store (as part of the Infomaniak ticketing system).
These triggers must be inserted into the “HEAD” section of the advanced options in your store.
Examples of Meta Pixel and Google Tags
Refer to the external documentation for the Meta pixel:
!function(f,b,e,v,n,t,s){
if(f.fbq)return;
n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;
n.version='2.0';
n.queue=[];
t=b.createElement(e);
t.async=!0;
t.src=v;
s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)
}(window,document,'script','https://connect.facebook.net/en_US/fbevents.js');
document.addEventListener("ike_event_view", function( e ) {
fbq('init', '14085424191xxxxx');
fbq('track', "PageView");
fbq('track', 'InitiateCheckout');
});
document.addEventListener("ike_cart_payment_launched", function( e ) {
fbq('init', '14085424191xxxxx');
fbq('track', "PageView");
fbq('track', 'Purchase', {value: e.detail.topaid, currency: e.detail.currency.name});
});… and for Google Tag Manager (GTM) + gtag.js:
window.dataLayer = window.dataLayer || [ ];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-xxxxxxx-x');
document.addEventListener("ike_event_view", function( e ) {
gtag('event', 'view_item', {
'event_category' : e.detail.name,
'event_label' : e.detail.date
});
});
document.addEventListener("ike_cart_add", function( e ) {
gtag('event', 'add_to_cart');
});
document.addEventListener("ike_cart_confirm", function( ) {
gtag('event', 'checkout_progress', {
'event_category' :'valid cart'
});
});
document.addEventListener("ike_cart_payment_launched", function( e ) {
gtag('event', 'add_payment_info', {
'event_category' : 'payment',
'event_label' : e.detail.currency.name,
'value': e.detail.topaid
});
});In Google Tag Manager, make sure that the format for the tags is respected:
(view_item|add_cart|add_payment_info)
CSP and its impact on conversion tracking
The “Content Security Policy” (CSP) is a web security policy that protects pages against certain attacks such as Cross-Site Scripting (XSS) and the injection of malicious content. However, it can also block certain legitimate scripts, such as Meta tracking pixels or Google Tag Manager, thus preventing conversion tracking from working correctly.
Why do some pixels not work?
If your website displays an error related to the Content Security Policy (CSP), particularly in the browser's developer tools console or network tab, it means that certain third-party scripts – such as Google tags or Meta (Facebook) pixels – are being blocked. To ensure that conversion tracking functions correctly on your store, it is necessary to add a specific exception to your site's CSP configuration to allow the resources used by the Infomaniak ticketing system.
Main CSP directives impacting tracking
script-src: defines the allowed sources for scripts.img-src: controls images (including<img>tags used for tracking pixels).connect-src: manages tracking requests sent to marketing tool servers.
For example, if you use Google Tag Manager or Facebook Pixel, make sure your CSP policy explicitly allows loading scripts and sending data to their domains. Here is an example of directives to include in your CSP, which you should adapt according to your configuration:
script-src 'self' https://www.googletagmanager.com https://www.google-analytics.com https://connect.facebook.net;
img-src 'self' https://www.google-analytics.com https://www.facebook.com;
connect-src 'self' https://www.google-analytics.com https://www.facebook.com;Google provides a detailed guide on configuring CSP that is compatible with its tracking tools.
Also, check that your security management system (application firewall, CDN, CMS) is not blocking these resources, and make the necessary adjustments to ensure that tracking events are triggered correctly.
If your CSP is too restrictive, it may prevent third-party scripts from loading, such as:
- Facebook Pixel (connect.facebook.net)
- Google Tag Manager (GTM) (www.googletagmanager.com)
- Google Analytics (www.google-analytics.com)
Errors visible in the developer console (browser's Developer Tools):
Refused to load the script 'https://connect.facebook.net/en_US/fbevents.js' because it violates the following Content Security Policy directive: "script-src 'self'"
- Absence de données dans Google Analytics ou Facebook Ads Manager.
- Events defined in GTM failed to trigger.
When the CSP blocks these resources, they cannot collect data on visitors or record conversion events.
Complete list of triggers
Home page:
trigger: ike_home_view
Data: none
document.addEventListener("ike_home_view", function(e) {
//send to your tracking tool
});Event page:
Page of an event with multiple dates
trigger: ike_event_view
Data: detail.name
document.addEventListener("ike_event_view", function(e) {
console.log(e.detail.name);
//send to your tracking tool
});Date page:
Page displaying event details
trigger: ike_date_view
Data: detail.name, detail.date
document.addEventListener("ike_date_view", function(e) {
console.log(e.detail.name, e.detail.date);
// Send to your tracking tool
});Pass page:
Page of a pass category
trigger: ike_abo_view
Data: detail.name
document.addEventListener("ike_abo_view", function(e) {
console.log(e.detail.name);
// Send to your tracking tool
});Pass selection page:
Page for selecting pass dates
trigger: ike_abo_selection
Data: detail (cart details)
document.addEventListener("ike_abo_selection", function(e) {
console.log(e.detail.name, e.detail.date);
//send to your tracking tool
});User login:
Triggered on successful login
trigger: ike_user_login
Data: detail (cart details)
document.addEventListener("ike_user_login", function(e) {
console.log(e.detail);
// Send to your tracking tool
});
User logout:
User logout:
trigger: ike_user_logout
Data: detail (cart details)
document.addEventListener("ike_user_logout", function(e) {
console.log(e.detail);
// send to your tracking tool
});Cart add:
Triggered when an item is added to the cart
trigger: ike_cart_add
Data: detail (cart details)
document.addEventListener("ike_cart_add", function(e) {
console.log(e.detail);
// send to your tracking tool
});Cart page:
trigger: ike_cart_view
Data: detail (cart details)
document.addEventListener("ike_cart_view", function(e) {
console.log(e.detail);
// Send to your tracking tool
});Cart update:
Triggered when a cart item is updated
trigger: ike_cart_update
Data: detail (cart details)
document.addEventListener("ike_cart_update", function(e) {
console.log(e.detail);
// Send to your tracking tool
});Cart empty:
Triggered when the empty button is pressed
trigger: ike_cart_empty
Data: detail (cart details)
document.addEventListener("ike_cart_empty", function(e) {
console.log(e.detail);
// Send to your tracking tool
});Cart confirm:
Triggered when the confirm button is pressed
trigger: ike_cart_confirm
Data: detail (cart details)
document.addEventListener("ike_cart_confirm", function(e) {
console.log(e.detail);
// Send to your tracking tool
});Cart delivery page:
trigger: ike_cart_delivery_view
Data: detail (cart details)
document.addEventListener("ike_cart_delivery_view", function(e) {
console.log(e.detail);
// send to your tracking tool
});Cart form page:
trigger: ike_cart_form_view
Data: detail (cart details)
document.addEventListener("ike_cart_form_view", function(e) {
console.log(e.detail);
// Send to your tracking tool
});Cart payment page:
trigger: ike_cart_payment_view
Data: detail (cart details with paymentMethodSelected)
document.addEventListener("ike_cart_payment_view", function(e) {
console.log(e.detail);
// send to your tracking tool
});Cart payment changed:
trigger: ike_cart_payment_changed
Data: detail.path
document.addEventListener("ike_cart_payment_changed", function(e) {
console.log(e.detail);
// Send to your tracking tool
});Cart payment initiated:
trigger: ike_cart_payment_launched
Data: detail (cart details)
document.addEventListener("ike_cart_payment_launched", function(e) {
console.log(e.detail);
// send to your tracking tool
});Cart payment success page:
trigger: ike_cart_payment_success
Data: detail (cart details)
document.addEventListener("ike_cart_payment_success", function(e) {
console.log(e.detail);
//send to your tracking tool
});
Cart delete item:
Cart delete item:
trigger: ike_cart_delete
Data: detail (previousCart and newCart)
document.addEventListener("ike_cart_delete", function(e) {
console.log(e.detail);
// send to your tracking tool
});Page Changed:
trigger: ike_page_changed
Data: detail.path
document.addEventListener("ike_page_changed", function(e) {
console.log(e.detail);
// Send to your tracking tool
});Link to this FAQ: https://faq.infomaniak.com/2664
Has this FAQ been helpful?