Skip to content

Instantly share code, notes, and snippets.

let value;
try {
const elements = Array.from(document.querySelectorAll('.oc-product-total .item-total'));
const numberElements = elements.filter(el => !isNaN(parseFloat(el.textContent)));
if (numberElements.length > 0) {
value = parseFloat(numberElements[0].textContent);
}
} catch (error) {
console.error(error);
}
@Stockotaco
Stockotaco / fs_ecommerce_events_tag.html
Last active December 20, 2022 16:50
Ecommerce Events Tag
<script>
// Configuration Pieces (Likely don't touch these)
function ensureTrailingSlash(path) {
if (path.substr(-1) !== '/') {
return path + '/';
}
return path;
}
var page_path = {{ Page Hostname }} + ensureTrailingSlash({{ Page Path }});
@Stockotaco
Stockotaco / thrivecart.js
Last active February 2, 2022 05:42
ThoughtMetric
var products = [];
customerFullName = _thrive_order.customer.name;
if (_thrive_order.order.product) {
var product = {
// product_id: "product-" + _thrive_order.order.product.id,
product_name: _thrive_order.order.product.name,
unit_price: _thrive_order.order.product.total,
quantity: _thrive_order.order.product.quantity,
// category: "product",
@Stockotaco
Stockotaco / body-with-log.liquid
Last active March 20, 2023 20:54
Shopify Scripts - Analyzify
<!-- 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','{{ shop.metafields.gtm.tracking_id }}');</script>
<!-- End Google Tag Manager -->
<script type="text/javascript">
var jQuery351;
window.dataLayer = window.dataLayer || [];
@Stockotaco
Stockotaco / modifyIframe.js
Last active January 14, 2022 02:16
stealth seminar add uid to data-src attribute
function modifyFrames() {
var allIframes = document.querySelectorAll("iframe[data-src]");
allIframes.forEach(function (iframe) {
iframe.setAttribute(
"data-src",
iframe.getAttribute("data-src") +
"&uid=" +
window.CLabsgbVar.generalProps.uid
);
});
@Stockotaco
Stockotaco / thrivecart_embed_linker.js
Created May 16, 2021 00:45
ThriveCart Embed Linker v1
(function () {
var getCookie = function (name) {
var nameEQ = name + '=';
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
}
return null;
@Stockotaco
Stockotaco / Shopify Checkout Steps
Last active September 3, 2020 15:37
shopify checkout steps
<script>
var ShopifyCheckoutstep = Shopify.Checkout.step;
switch (ShopifyCheckoutstep) {
case 'contact_information':
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'contact_information',
});
break;
case 'shipping_method':
<script>
$('[id*="inf_form"]').on('submit', function () {
window.funnelytics.events.trigger("form-submit", {
form: formTitle,
}, function() {
// continue with process..
});
})
</script>
<div class="background-container">
<div class="main-container">
        
<div class="video-container">
        
<iframe
src="https://fast.wistia.net/embed/iframe/9wwdspa3u5?videoFoam=true"
title="Free One-Hour Filmmaking Training - Current Video"
frameborder="0"
allowfullscreen