This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Overview | |
Google Analytics Enhanced Ecommerce enables product impression, promotion, and sales data to be sent with any of your Google Analytics pageviews and events. | |
You should review the Enhanced Ecommerce Data Types and Actions section of the Enhanced Ecommerce Dev Guide before you begin. The guide will help you understand which fields are required for each of the ecommerce interactions you want to measure. | |
https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce | |
The Ecommerce Process |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$transactionId='test1001'; | |
$sku=array('test1003','test1001','test1002'); | |
$name=array('six1','six2','six3'); | |
$category=array('142139113','161477257','574557754'); | |
$price=array(53.90,9.99,36.36); | |
$quantity=array(1.00,1.00,1.00); | |
$transactionAffiliation='affil'; | |
$transactionTotal='100.25'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var orderId = '12345'; | |
var OrderTotal = 100.25; | |
var attraction = 'new'; | |
var ShippingCity = 'wilts'; | |
var ShippingCountyState = 'london'; | |
var ShippingCountry = 'england'; | |
var ShippingMethod = 3.99; | |
var OrderTax = 11.99; | |
var ItemSKU = ["1234567890", "0987654321", "123456789012"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<script> | |
var vimeoTag = document.getElementsByTagName('iframe'); | |
for(i=0; i<vimeoTag.length; i++){ | |
var newSrc = vimeoTag[i].src + '?api=1&player_id=player_' + i; | |
vimeoTag[i].id = 'player_' + i; | |
vimeoTag[i].src = newSrc; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 2. Modify your site’s prospect lead information submission page — usually, a lead submission form — to read the | |
* GCLID from the cookie and pass it along to your lead management system, along with the lead’s contact information. | |
* You can retrieve the GCLID value via your choice of client- or server-side languages. Once retrieved, it’s a good | |
* idea to pass the GCLID through your lead submission form as a hidden field element. | |
* Here’s an example form with a hidden field for collecting the GCLID. You should insert the highlighted <input> | |
*/ tag in between your <form> tags.: | |
<form action="" name="myForm"> | |
Name: <input type="text" name="name"> | |
<input type="hidden" id="gclid" name="gclid" value=""> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://support.google.com/adwords/answer/1722054?hl=en-GB#calls_from_websites | |
<script> | |
(function(a,e,c,f,g,b,d){var h={ak:"1068572616",cl:"J3467990UQyL577QM"};a[c]=a[c]||function(){(a[c].q=a[c].q||[]).push(arguments)};a[f]||(a[f]=h.ak);b=e.createElement(g);b.async=1;b.src="//www.gstatic.com/wcm/loader.js";d=e.getElementsByTagName(g)[0];d.parentNode.insertBefore(b,d);a._googWcmGet=function(b,d,e){a[c](2,b,h,d,null,new Date,e)}})(window,document,"_googWcmImpl","_googWcmAk","script"); | |
</script> | |
<body onload="_googWcmGet('phone-number', '01225 746 967')"> | |
<span class="phone-number">01225 746 967</span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var cartProducts = []; | |
var dataLayer = []; | |
for(var i=0; i<x; i++){ | |
cartProducts.push({ | |
'id': transactionId, | |
'sku': sku[i], // string; product ID | |
'name': name[i], // string; product name | |
'category': category[i], // string; category name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$transactionId='test1001'; | |
$sku=array('test1003','test1001','test1002'); | |
$name=array('six1','six2','six3'); | |
$category=array('142139113','161477257','574557754'); | |
$price=array(53.90,9.99,36.36); | |
$quantity=array(1.00,1.00,1.00); | |
$transactionAffiliation='affil'; |