Skip to content

Instantly share code, notes, and snippets.

@tvpmb
tvpmb / creatable_shopify_pixel_purejs.js
Last active January 22, 2025 21:52
Creatable Shopify Pixel - Pure JS
<script type="text/javascript">
let order = Shopify.checkout;
let tid = order.order_id === null ? null : order.order_id;
let products = order.line_items.map(item => ({
sku: item.product_id,
price: item.price,
quantity: item.quantity
}));
let orderData = {};
@tvpmb
tvpmb / creatable-carousel.liquid
Last active September 5, 2024 18:57
Creatable Carousel Section for Shopify
@tvpmb
tvpmb / creatable_shopify_pixel.js
Created June 18, 2024 15:35
Shopify Conversion Pixel Script
<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';
let s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(tvpa, s);
})();
if (Shopify.hasOwnProperty('checkout')) {
var purchases = Shopify.checkout.line_items;
var orderId = Shopify.checkout.order_id;
var items = [];
for (var x = 0; x < purchases.length; x++) {
items.push({
sku: purchases[x]['sku'],
price: purchases[x]['price'],
<a class="tvp-sidebar" data-id="sidebar-dynamic" data-domain="//widgets.domain.com">TVPage Sidebar Dynamic</a>
<script>
window.__TVPage__ = window.__TVPage__ || {};
__TVPage__.config = __TVPage__.config || {};
__TVPage__.config["sidebar-dynamic"] = {
loginid: "XXXXXXX",
channel: {
"id": "00000000",
"parameters": {
"main_category": "123456789"
@tvpmb
tvpmb / TVPage_GA_Tracker.js
Last active December 4, 2015 19:00
TVPage Conversion Tracking with Google Analytics
var _tvpa = _tvpa || [];
_tvpa.push(['config', {
tr: "XXX", // Data source ID
li: "YYY", // Account ID
gaDomain: "domain.tv" // For use with a TVPage Video Commerce Site
}]);
@tvpmb
tvpmb / 3DCart_5.js
Created December 15, 2014 18:52
3D Cart - Part 5
<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', {
//**********************************************************************
@tvpmb
tvpmb / 3DCart_4.html
Created December 15, 2014 18:44
3D Cart - Part 4
<!--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>
<script>
@tvpmb
tvpmb / 3DCart_3.js
Created December 15, 2014 18:42
3D Cart - Part 3
<script>
$Cnt++;
$SKUArr[$Cnt]="[id]";
$PriceArr[$Cnt]="[unitprice]";
$PriceArr[$Cnt] = $PriceArr[$Cnt].replace("$","");
$QtyArr[$Cnt]= [numitems];
</script>
@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-->