Skip to content

Instantly share code, notes, and snippets.

View aristideriou's full-sized avatar

Aristide Riou aristideriou

View GitHub Profile
canonical (string)
Non défini
cart_id (string)
1726587618
cart_creation_utc (number)
1726587745
cart_currency (string)
EUR
cart_nbdistinctproduct (number)
1
{
"exportFormatVersion": 2,
"exportTime": "2024-04-02 10:07:36",
"containerVersion": {
"path": "accounts/6051890362/containers/178295699/versions/0",
"accountId": "6051890362",
"containerId": "178295699",
"containerVersionId": "0",
"container": {
"path": "accounts/6051890362/containers/178295699",
@aristideriou
aristideriou / anacours_dl.md
Created March 16, 2024 09:32
Anacours - Data layer validation

Au moment de la validation des formulaires (Anacours / Anacours musique), alimenter le data layer de la façon suivante :

window.dataLayer = window.dataLayer || [];
dataLayer.push({
  'event' : 'formValid' //String : constant
  'formValid' : {   
    'email' : 'pierre.dupont@gmail.com', //String : Email de l'utilisateur renseigné sur le formulaire
    'phone' : '06 12 34 56 78', //String : Numéro de téléphone de l'utilisateur renseigné sur le formulaire
 'firstName' : 'Pierre', //String : Prénom de l'utilisateur renseigné sur le formulaire
{
"exportFormatVersion": 2,
"exportTime": "2024-02-26 09:23:12",
"containerVersion": {
"path": "accounts/6051890362/containers/178295699/versions/0",
"accountId": "6051890362",
"containerId": "178295699",
"containerVersionId": "0",
"container": {
"path": "accounts/6051890362/containers/178295699",
SELECT
*
FROM
`bigquery-public-data.ga4_obfuscated_sample_ecommerce.events_20210115`
LIMIT
100
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-M07MJGGK1Q"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-M07MJGGK1Q');
</script>
@aristideriou
aristideriou / kids paradis
Created August 11, 2023 08:18
Specs analytics Kids Paradis
Introduction
Spécifications techniques pour le setup Google Tag Manager du site https://kidsparadis.com/.
Contact : aristide.riou@gmail.com
1 - Configuration des CSP pour Google Tag Manager
Les directives Content Security Policy suivantes doivent être mises en place afin de prermettre la bonne exécution des tags depuis GTM : https://developers.google.com/tag-manager/web/csp
2 - Appel du snippet GTM
Insérer ce code aussi haut que possible dans le <head> de la page :
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PSW1MY7HB4"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-PSW1MY7HB4');
</script>
<script type="text/javascript">
(function(window, document, dataLayerName, id) {
window[dataLayerName]=window[dataLayerName]||[],window[dataLayerName].push({start:(new Date).getTime(),event:"stg.start"});var scripts=document.getElementsByTagName('script')[0],tags=document.createElement('script');
function stgCreateCookie(a,b,c){var d="";if(c){var e=new Date;e.setTime(e.getTime()+24*c*60*60*1e3),d="; expires="+e.toUTCString()}document.cookie=a+"="+b+d+"; path=/"}
var isStgDebug=(window.location.href.match("stg_debug")||document.cookie.match("stg_debug"))&&!window.location.href.match("stg_disable_debug");stgCreateCookie("stg_debug",isStgDebug?1:"",isStgDebug?14:-1);
var qP=[];dataLayerName!=="dataLayer"&&qP.push("data_layer_name="+dataLayerName),isStgDebug&&qP.push("stg_debug");var qPString=qP.length>0?("?"+qP.join("&")):"";
tags.async=!0,tags.src="https://mgp.containers.piwik.pro/"+id+".js"+qPString,scripts.parentNode.insertBefore(tags,scripts
<script type="text/javascript">
document.addEventListener('Botmind_ChatOpened', function (e) {
ga('gtm2.send', {hitType: 'event', eventCategory: 'Botmind', eventAction: 'ChatOpened', eventLabel: 'ChatOpened'});
}, false);
document.addEventListener('Botmind_ChatClosed', function (e) {
ga('gtm2.send', {hitType: 'event', eventCategory: 'Botmind', eventAction: 'ChatClosed', eventLabel: 'ChatClosed'});
}, false);
document.addEventListener('Botmind_MessageSent', function (e) {
ga('gtm2.send', {hitType: 'event', eventCategory: 'Botmind', eventAction: 'MessageSent', eventLabel: 'MessageSent'});