Skip to content

Instantly share code, notes, and snippets.

@tvpmb
tvpmb / 3DCart_2.html
Created December 15, 2014 18:40
3D Cart - Part 2
<!--START: items-->
<div class="row">
<div class="invoice-id">[id]</div>
<div class="invoice-items">[itemname]</div>
<div class="invoice-price">[unitprice]</div>
<div class="invoice-qty">[numitems]</div>
<div class="invoice-total">[subtotal]</div>
<div class="clear"></div>
</div>
<!--END: items-->
@tvpmb
tvpmb / 3D_Cart_1.js
Created December 15, 2014 18:36
3D Cart - Part 1
<script>
$SKUArr = new Array();$PriceArr = new Array();$QtyArr = new Array();$Cnt=0;
</script>
@tvpmb
tvpmb / TVPage_Shopify_Conversion_Tracking.js
Last active August 29, 2015 14:10
TVPage_Shopify_Conversion_Tracking
<script>
$SKUArr = new Array();$PriceArr = new Array();$QtyArr = new Array();
</script>
{% for line_item in line_items %}
<script>
$SKUArr['{{ forloop.index }}']="{{ line_item.sku }}";
$PriceArr['{{ forloop.index }}']="{{ line_item.line_price | money_without_currency }}";
$QtyArr['{{ forloop.index }}']="{{ line_item.quantity }}";
</script>
{% endfor %}
@tvpmb
tvpmb / TVPage_Sales_Tracking.js
Created November 19, 2014 17:11
TVPage Sales Tracking
_tvpa.push(['track', 'products', [
{ sku:"bb8100", price:"14.99", quantity: 4 },
{ sku:"8525PDA", price:"59.99", quantity: 1 },
{ sku:"MM-A900M", price:"5.00", quantity: 3 }
]
]);
@tvpmb
tvpmb / TVPage_Analytics_Tracker_Config.js
Created November 19, 2014 17:10
TVPage Analytics Tracker Config
var _tvpa = _tvpa || [];
_tvpa.push(['config', {
tr: "XXX", // Data source ID
li: "YYY" // Account ID
}]);
@tvpmb
tvpmb / TVPage_Analytics_Library.js
Created November 19, 2014 17:09
TVPage Analytics Library
(function() {
var tvpa = document.createElement('script'); tvpa.type = 'text/javascript'; tvpa.async = true;
tvpa.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://a.tvpage.com/tvpa.min.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(tvpa, s);
})();
@tvpmb
tvpmb / TVPage_AmazonWebstore_Conversion_Tracker.js
Created October 14, 2014 22:46
TVPage_AmazonWebstore_Conversion_Tracker
<script type="text/javascript">
var orders = amznAnalytics.getList("multiOrderPurchase");
var products = [];
if(orders && orders.length > 0) {
for(var n = 0; n < orders.length ; n++) {
for(var i = 0; i < orders[n].itemList.length; i++) {
products.push({ "sku":orders[n].itemList[i].SKU,"price":orders[n].itemList[i].unitPrice,"quantity":orders[n].itemList[i].quantity});
}
}
@tvpmb
tvpmb / Generic_Lead_Gen_Tracker.js
Created October 7, 2014 16:32
Generic Lead Gen Tracker
<script type="text/javascript">
(function() {
var tvpa = document.createElement('script'); tvpa.type = 'text/javascript'; tvpa.async = true;
tvpa.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://a.tvpage.com/tvpa.min.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(tvpa, s);
})();
var _tvpa = _tvpa || [];
_tvpa.push(['config', {
tr: "XXX", // Data source ID
@tvpmb
tvpmb / gist:4dc0a96db6c3e66e1d1c
Created August 22, 2014 01:52
TVPage Analytics Debug Mode Configuration
_tvpa.push(['config', {
debug: true,
tr: "XXX", // Data source ID
li: "YYY" // Account ID
}]);
@tvpmb
tvpmb / gist:37c0dc3910458de5341c
Created August 22, 2014 01:51
TVPage Analytics Initial Configuration request
_tvpa.push(['config', {
tr: "XXX", // Data source ID
li: "YYY" // Account ID
}]);