window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'AW-18537797417'); (function () { if (window.vdPurchaseTrackingBound) return; window.vdPurchaseTrackingBound = true; var checkoutPromise; var sent = Object.create(null); function hasConsent() { try { var cookie = document.cookie.split('; ').find(function (c) { return c.indexOf('privacy_embeds=') === 0; }); return !!cookie && decodeURIComponent(cookie.slice(cookie.indexOf('=') + 1)).indexOf('awb_snip_google-ads-videsigner') !== -1; } catch (error) { return false; } } function recordPurchase(response) { var p = response && response.purchase; if (!hasConsent() || !p || p.trial_ends || p.is_sandbox || p.is_test) return; if (p.plugin_id && String(p.plugin_id) !== '42217') return; var id = p.id != null ? String(p.id) : ''; var value = Number(p.initial_amount != null ? p.initial_amount : p.gross); var currency = String(p.currency || '').toUpperCase(); if (!id || !Number.isFinite(value) || value <= 0 || !/^[A-Z]{3}$/.test(currency) || sent[id]) return; sent[id] = true; gtag('event', 'conversion', { send_to: 'AW-18537797417/SJUvCMGnn7kdEKmuwYdF', value: value, currency: currency, transaction_id: id }); } function loadCheckout() { if (window.FS && window.FS.Checkout) return Promise.resolve(); if (checkoutPromise) return checkoutPromise; checkoutPromise = new Promise(function (resolve, reject) { var script = document.createElement('script'); script.src = 'https://checkout.freemius.com/js/v1/'; script.async = true; var timer = setTimeout(function () { reject(new Error('Checkout timeout')); }, 12000); script.onload = function () { clearTimeout(timer); if (window.FS && window.FS.Checkout) resolve(); else reject(new Error('Checkout unavailable')); }; script.onerror = function () { clearTimeout(timer); reject(new Error('Checkout unavailable')); }; document.head.appendChild(script); }); return checkoutPromise; } document.addEventListener('click', function (event) { if (event.defaultPrevented || event.button !== 0 || event.ctrlKey || event.metaKey || event.shiftKey || event.altKey || !hasConsent()) return; var link = event.target.closest && event.target.closest('a[href]'); if (!link) return; var url; try { url = new URL(link.href); } catch (error) { return; } if (url.origin !== 'https://checkout.freemius.com' || ['/plugin/42217/plan/73463/', '/product/42217/plan/73463/', '/plugin/42217/plan/73463', '/product/42217/plan/73463'].indexOf(url.pathname) === -1 || url.search) return; event.preventDefault(); if (link.getAttribute('aria-busy') === 'true') return; link.setAttribute('aria-busy', 'true'); loadCheckout().then(function () { if (!hasConsent()) { window.location.assign(link.href); return; } var handler = new FS.Checkout({ product_id: '42217', plan_id: '73463', public_key: 'pk_ebdb2a910be7e1846701826399c79' }); handler.open({ name: 'ViDesigner Christmas Calendar PRO', licenses: 1, purchaseCompleted: recordPurchase }); link.removeAttribute('aria-busy'); }).catch(function () { link.removeAttribute('aria-busy'); window.location.assign(link.href); }); }); })();
Go to Top