jQuery(document).ready(function () { let targetElement = jQuery('.product_title, .entry-title'); if (targetElement != null && targetElement.length > 0) { console.log('Target element found!'); jQuery(targetElement).after("
"); } else { targetElement = jQuery('body'); //jQuery(targetElement).after("
"); } if (window.convertflow == undefined) { var script = document.createElement('script'); script.async = true; script.src = "https://js.convertflow.co/production/websites/34379.js"; document.body.appendChild(script); }; let collectedDataSets = []; jQuery(document).on('cfReady', function (event) { collectedDataSets = []; }); jQuery(document).on('cfSubmit', function (event, data) { collectedDataSets.push(data); }); jQuery(document).on('cfCompletion', function (event, data) { debugger; let productIdText = jQuery('div.product').attr('id'); let productId = 0; if (productIdText != null && productIdText !== undefined) { const productIdTextArray = productIdText.split("-"); productId = productIdTextArray.length > 1 ? productIdTextArray[1] : '0'; } const model = { apiKey: '05Yc8xsHE1QN3227u0PsRtz8FbGf14BNepkqs6jE0', clientKey: 'e37fd9b8-b2fe-42b1-bc1a-81b7539369b8', inquiryLink: window.location.href, productId: productId, data: JSON.stringify(collectedDataSets) }; jQuery.post({ url: 'https://dashboard.performnow.net/api/ConvertFlow/Push', data: JSON.stringify(model), contentType: 'application/json; charset=utf-8' }); }); });