Random HTML Code appearing below my footer

I am having an issue on my website where there is random code appearing below the footer. It says: window.addEventListener(‘load’, function() { var _learnq = window._learnq || ; function addedToCart() { fetch(${window.location.origin}/cart.js) .then(res => res.clone().json().then(data => { var cart = { total_price: data.total_price/100, $value: data.total_price/100, total_discount: data.total_discount, original_total_price: data.original_total_price/100, items: data.items } if (item !== ‘undefined’) { cart = Object.assign(cart, item) } if (klAjax) { _learnq.push([‘track’, ‘Added to Cart’, cart]); klAjax = false; } })) }; (function (ns, fetch) { ns.fetch = function() { const response = fetch.apply(this, arguments); response.then(res => { if (${window.location.origin}/cart/add.js .includes(res.url) && res.url !== ‘’) { addedToCart() } }); return response } }(window, window.fetch)); var klAjax = true; var atcButtons = document.querySelectorAll(“form[action*=‘/cart/add’] button[type=‘submit’]”); for (var i = 0; i < atcButtons.length; i++) { atcButtons[i].addEventListener(“click”, function() { if (klAjax) { _learnq.push([‘track’, ‘Added to Cart’, item]); klAjax = false; } }) } });

It also ONLY appears on the product page. Here is a link: My product page

Please help. This is really hard to deal with for new customers coming to our site. thank you

1 Like

Hello @charleyh90
Search this code in your main.min.css and delete.

Thanks

Hello @charleyh90

  1. Go to Online Store > Themes > Actions > Edit Code** in your Shopify admin.

  2. In the Templates folder, check for the product.liquid or product.json file.

  3. In the Sections folder, open the main-product.liquid or product-template.liquid file.

  4. Search for ‘window._learnq’, and remove the script.

Let me know if you need further clarification! :blush:

‘window._learnq’ is not in any of these sections of code. Can you please help further?

1 Like

There is no main.min.css. Where can I find this?

Hello @charleyh90
Could you grant me access? I will check and remove the code for you.

I sent invite to devcodersp . Thank you

1 Like

It is still there. what happened?

1 Like

Hello @charleyh90
I just checked, and you have removed access. Please go to the theme.liquid file and search for window._learnq. If the <script> tag is not opened, then it won’t work properly.