1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Ticketing: insert a Meta / Google tracker on the store
This guide provides you with 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 in the “HEAD” section of the advanced options on your store.
Examples of Meta and Google Tags pixels
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 the 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.name,
'event_label' : e.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' : 'paiement',
'event_label' : e.detail.currency.name,
'value': e.detail.topaid
});
});On the Google Tag Manager, make sure 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 malicious content injection. However, it can also block certain legitimate scripts, such as Meta or Google Tag Manager tracking pixels, thus preventing proper conversion tracking.
Why are some pixels not working?
If your website displays an error related to the Content Security Policy (CSP), particularly in the console or network tab of the browser’s developer tools, this means that certain third-party scripts — such as Google tags or Meta (Facebook) pixels — are blocked. To ensure proper conversion tracking on your store, it is necessary to add a specific exception in the CSP configuration of your site to allow the resources used by the Infomaniak ticketing system.
Main CSP directives impacting tracking
script-src‍: defines the authorized sources for scripts.img-src‍: controls images (including the<img>tags used for tracking pixels).connect-src‍: manages tracking requests sent to the servers of marketing tools.
For example, if you are using Google Tag Manager or Facebook Pixel, make sure your CSP policy explicitly allows the loading of scripts and the sending of data to their domains. Here is an example of directives to include in your CSP, to be adapted 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 compatible with its tracking tools.
Also, check that your security management system (application firewall, CDN, CMS) does not block these resources, and apply the necessary adjustments to allow proper triggering of tracking events.
If your CSP is too restrictive, it can prevent the loading of third-party scripts 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 (Developer tools) of the browser:
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 of data in Google Analytics or Facebook Ads Manager.
- Failure to trigger events defined in GTM.
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_home_view", function(e) {
console.log(e.detail.name);
//send to your tracking tool
});Date page:
Page of a date of an event
trigger : ike_date_view
Data : detail.name, detail.date
document.addEventListener("ike_home_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 of passes dates selection
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 login success
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:
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 element added to 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 element 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 empty button 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 confirm button 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 launched:
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:
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
});