Shopify analytics do not work only purchases are tracked

Shopify analytics do not work only purchases are tracked

stanlegebeke
Excursionist
38 0 2

Hello, 

My shopify analytics do not work since optimizing my theme last year february 2023. 

I did not make the right back-up and since then shopify tracking does not work. Also my email conversions are not measured since then. 

stanlegebeke_1-1737735034706.png

 

stanlegebeke_2-1737735034719.png


Does anybody know how I, can get them up and running again? 

I would almost rebuild my entire store
My store is www.uwdiervoeding.nl
Kind regards
Stan Legebeke

UwDiervoeding.nl | Founder
Replies 11 (11)

Huptech-Web
Shopify Partner
1047 208 225

Hi @stanlegebeke 

I checked the store through the URL and found that the code for analytics is Lazy loaded.

 

To remove that, you can edit the theme, search the file theme.liquid, and find the code below. Once the code will be remove the analytics will work properly.

const observer = new MutationObserver(e => { e.forEach(({ addedNodes: e }) => { e.forEach(e => { 1 === e.nodeType && "SCRIPT" === e.tagName && (e.innerHTML.includes("asyncLoad") && (e.innerHTML = e.innerHTML.replace("if(window.attachEvent)", "document.addEventListener('asyncLazyLoad',function(event){asyncLoad();});if(window.attachEvent)").replaceAll(", asyncLoad", ", function(){}")), e.innerHTML.includes("PreviewBarInjector") && (e.innerHTML = e.innerHTML.replace("DOMContentLoaded", "asyncLazyLoad")), (e.className == 'analytics') && (e.type = 'text/lazyload'),(e.src.includes("assets/storefront/features")||e.src.includes("assets/shopify_pay")||e.src.includes("connect.facebook.net"))&&(e.setAttribute("data-src", e.src), e.removeAttribute("src")))})})});observer.observe(document.documentElement,{childList:!0,subtree:!0})



If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required
stanlegebeke
Excursionist
38 0 2

Hello, thanks for replying. When I search through the theme liquid. I cannot seem to find this code with ctrl f: const observer = new MutationObserver(e => { e.forEach(({ addedNodes: e }) => { e.forEach(e => { 1 === e.nodeType && "SCRIPT" === e.tagName && (e.innerHTML.includes("asyncLoad") && (e.innerHTML = e.innerHTML.replace("if(window.attachEvent)", "document.addEventListener('asyncLazyLoad',function(event){asyncLoad();});if(window.attachEvent)").replaceAll(", asyncLoad", ", function(){}")), e.innerHTML.includes("PreviewBarInjector") && (e.innerHTML = e.innerHTML.replace("DOMContentLoaded", "asyncLazyLoad")), (e.className == 'analytics') && (e.type = 'text/lazyload'),(e.src.includes("assets/storefront/features")||e.src.includes("assets/shopify_pay")||e.src.includes("connect.facebook.net"))&&(e.setAttribute("data-src", e.src), e.removeAttribute("src")))})})});observer.observe(document.documentElement,{childList:!0,subtree:!0})

Can I send you a collaborator request. 

Kind regards
Stan Legebeke

UwDiervoeding.nl | Founder
stanlegebeke
Excursionist
38 0 2

I cannot seem to find it in my theme.liquid, theme.js liquid and my theme.scss liquid.

UwDiervoeding.nl | Founder
Huptech-Web
Shopify Partner
1047 208 225

@stanlegebeke 
Please share the collab. request code in message,

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required
stanlegebeke
Excursionist
38 0 2

Hello, Here is the code.

8326

Kind regards
Stan Legebeke

UwDiervoeding.nl | Founder
Huptech-Web
Shopify Partner
1047 208 225

Hi @stanlegebeke 
I requested the access can you please check it? 

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required
stanlegebeke
Excursionist
38 0 2
I confirmed it.
UwDiervoeding.nl | Founder
Huptech-Web
Shopify Partner
1047 208 225

Hi @stanlegebeke 

 

The code was added in this file social-meta-tags.liquid at the end of the file.

I just removed the code. It may take some time to load the analytics data. 

Please check it.

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required
stanlegebeke
Excursionist
38 0 2

Hello I checked it during the day. But we have around 60 to 100 visitors everyday from the netherlands. Here it does not show it in the dashboard.

stanlegebeke_0-1738166244350.png

It is collecting some data but not like we did. 

stanlegebeke_1-1738166302925.png

We had 3 orders since you changed it but also the orders are not tracked. There is no conversion rate etc.

 

 

UwDiervoeding.nl | Founder
Huptech-Web
Shopify Partner
1047 208 225

Hi @stanlegebeke 
It will take some time to load all the data correctly: You can find more details here: https://help.shopify.com/en/manual/reports-and-analytics/shopify-reports/overview-dashboard#data-on-...

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required
stanlegebeke
Excursionist
38 0 2

Hello,

I waited some time but still it doesn't show correcly. as an example I had 69 clicks on google ads 2 feb but shopify shows 16 sessions without a conversion. 

Kind regards
Stan Legebeke

stanlegebeke_1-1738567800311.png

 

stanlegebeke_0-1738567721083.png

 

UwDiervoeding.nl | Founder