Skip to content

Instantly share code, notes, and snippets.

@PauwR
PauwR / 1-productinformation
Last active December 6, 2018 14:52
Enhanced E-commerce - Carparts Expert en Car Bags
// These values could be used in every measurement. To keep the Github clean, we refer to this part:
...
'products': [{
'name': 'Alfa Romeo Stelvio 2016-heden Car-Bags reistassenset', // productname
'id': '8718885903508', // EAN
'price': '309.00', // use a . as seperator
'brand': 'Car Bags', // if there is only one brand, just use the company name: Car Bags / Car Parts Expert
'category': 'Reistassen/Audi/A6', // use a forward slash (/) to add sub-categories e.g. Brand and Model
'variant': '3 trolleytassen', // in case this applies, same product but different variant, e.g. color 'red/black'
@PauwR
PauwR / addtocart.js
Last active March 6, 2017 10:25
Enhanced E-commerce - Maaltijdservice.nl
// Toevoegen van een product aan de winkelwagen.
dataLayer.push({
'event': 'addToCart',
'ecommerce': {
'currencyCode': 'EUR',
'add': { // 'add' actionFieldObject measures.
'products': [{ // adding a product to a shopping cart.
'name': 'Runderbouillon', // Naam of ID is een verplicht veld.
'id': '12345',
@PauwR
PauwR / 00-STATIC-GTM-tracker.js
Last active December 28, 2017 14:00
Verzekeruzelf - Enhanced e-commerce
// Generic GTM Container Tracker!
// GTM code that needs to be placed within the <head></head> section of the page.
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-MCW6MJ');</script>
@PauwR
PauwR / stap-1-gegevens-invullen.js
Last active January 8, 2016 11:07
EE - Zuid-Hollands Landschap
dataLayer.push({
'event': 'checkout',
'ecommerce': {
'checkout': {
'actionField': {'step': 1},
'products': [{
'name': 'Productnaam',
'id': 'ProductID',
'price': '123.45',
'brand': 'Merk',