Solved

Google analytics ecommerce tracking stopped after app installing and uninstalling

kub
Pathfinder
118 2 43

Hallo all.

Since one month i have the problem that may analytics tracking (visitors and ecommerce stopped working)

What happened? I installed some apps (language translationa apps nothing regarding analytics)

Screenshot_20201213_230053.png

 

Since then my site doesn't submit any traffic to google analytics 

 

Screenshot_20201224_173237.png

 

Screenshot_20201224_173519.png

 

It's not a million dollar site but it is working quite well. 

I already opened tickets by support ( two ytickets) but i got only the reply that they forwarded to software departement (seems a standard reply when they don't know what to do) but nothing happend

I already read all setup hints and tutorials but they repeat only what i did in the original setup which was working until 20 november.

I was also able to get my visitors tracking working by adding manually the google analytics code in my theme.liquid

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-MYCODE"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-MYCODE');
</script>

 

Which allows me to track visitors but i am not able to track my ecommerce and ads traffic and yes i have enhanced ecommerce enabled

screenshot(3).jpg

Screenshot_20201224_174423.png

 

I tried to debug with Tag assistant in my browser and  there is no tag received when i take out the google script from my theme.liquid

Screenshot_20201224_174630.png

 

Also the native tracking code from shopify google analytics setup is available in the source code of my website but it doesn't track without my manually added script

    {"Trekkie":{"appName":"storefront","development":false,"defaultAttributes":{"shopId":27462959152,"isMerchantRequest":true,"themeId":80516284464,"themeCityHash":"10867798912432293319","contentLanguage":"it","currency":"EUR"},"isServerSideCookieWritingEnabled":true,"isPixelGateEnabled":true},"Performance":{"navigationTimingApiMeasurementsEnabled":true,"navigationTimingApiMeasurementsSampleRate":1},"Google Analytics":{"trackingId":"UA-MYCODE-1","domain":"auto","siteSpeedSampleRate":"10","enhancedEcommerce":true,"doubleClick":true,"includeSearch":true},"Facebook Pixel":{"pixelIds":["2427228690826214"],"agent":"plshopify1.2"},"Session Attribution":{}}

 

So my question is:

  1. Who from shopify can fix this ??? On my end i did anything. If the apps installed and uninstalled broke something it is not in my possibility to check and i don't think that any of these app providers will say YES it's ouìr fault (there was also a shopify native app involved)
  2. I tried to check in my source code if something regarding tracking was messed up ( i compared a virgin template code with my code) but there it seemed all ok

So SHOPIFY - staff please. As something seems not to work on your side and i want to grow this shop please check why it is not working and fix it. 

Please don't recommend external apps as you reccomend also to not install more than 10 apps for running well my shop. 

Thanks for reading and thanks in advance for your reply

 

Merry Xmas to all

 

Andreas

Accepted Solutions (2)

JoesIdeas
Shopify Expert
2194 201 587

This is an accepted solution.

If your Analytics ID is correct in the Google Analytics section in Shopify it should work for everything, I haven't seen that not work.. hmmm.

I would try this:

1) Double check the ID is correct for the property in analytics that you're trying to access. People often have multiple properties / views set up, just make sure your account ID matches.

2) If #1 isn't working, try opening up dev tools console on your site and see if there are JavaScript errors. Maybe there's some bad code preventing that script from executing. If you're not familiar working with the console, this shows you how: https://speedboostr.com/finding-and-fixing-server-errors.

3) Since the feature within Shopify is not working, but your script in theme.liquid is working, you can add the analytics script to your checkout to track orders / sales by going to Settings > Checkout > additional scripts (you'll have to add in variables for the order, example to get the order total, you use: {{ order.total_price }}.

 

I haven't done it the manual way in a few years so I don't have an exact script for you, but you should be able to search for something like "google analytics ecommerce tracking example", then for any variables you need, you can reference the Shopify liquid order object: https://shopify.dev/docs/themes/liquid/reference/objects/order

Hope that helps, what a pain!

• Creator of Order Automator (automate tagging, fulfillment, Amazon, notifications + more)
• Shopify developer for 10+ years, store owner for 7 years
• I also make guides like Shopify Automation Tips and How to Deal with Fraud / Chargebacks

View solution in original post

kub
Pathfinder
118 2 43

This is an accepted solution.

@JoesIdeas thanks gor your kind reply. I already tried to debug with console but i didn't get deeper in.

I also thought about the additional script option but my base question is:

What was messed up and it can happen with my private cms or ecommerce solution but not by a centralized service like shopify. This is why i skipped from my private system to shopify for not wasting time in tecnical debug...

Anyway if i find a solution i will post ot here. 

View solution in original post

Replies 14 (14)

JoesIdeas
Shopify Expert
2194 201 587

This is an accepted solution.

If your Analytics ID is correct in the Google Analytics section in Shopify it should work for everything, I haven't seen that not work.. hmmm.

I would try this:

1) Double check the ID is correct for the property in analytics that you're trying to access. People often have multiple properties / views set up, just make sure your account ID matches.

2) If #1 isn't working, try opening up dev tools console on your site and see if there are JavaScript errors. Maybe there's some bad code preventing that script from executing. If you're not familiar working with the console, this shows you how: https://speedboostr.com/finding-and-fixing-server-errors.

3) Since the feature within Shopify is not working, but your script in theme.liquid is working, you can add the analytics script to your checkout to track orders / sales by going to Settings > Checkout > additional scripts (you'll have to add in variables for the order, example to get the order total, you use: {{ order.total_price }}.

 

I haven't done it the manual way in a few years so I don't have an exact script for you, but you should be able to search for something like "google analytics ecommerce tracking example", then for any variables you need, you can reference the Shopify liquid order object: https://shopify.dev/docs/themes/liquid/reference/objects/order

Hope that helps, what a pain!

• Creator of Order Automator (automate tagging, fulfillment, Amazon, notifications + more)
• Shopify developer for 10+ years, store owner for 7 years
• I also make guides like Shopify Automation Tips and How to Deal with Fraud / Chargebacks
kub
Pathfinder
118 2 43

This is an accepted solution.

@JoesIdeas thanks gor your kind reply. I already tried to debug with console but i didn't get deeper in.

I also thought about the additional script option but my base question is:

What was messed up and it can happen with my private cms or ecommerce solution but not by a centralized service like shopify. This is why i skipped from my private system to shopify for not wasting time in tecnical debug...

Anyway if i find a solution i will post ot here. 

kub
Pathfinder
118 2 43

Screenshot_20201225_005019.png

That's the only error i get and i can't find also where it comes from.

BeatriceRossi
Visitor
2 0 0

Hi,

it seems I'm facing the same problem in GA tracking, but I can't understand which is the problem that stopped GA eCommerce tracking. I see correct GA data until 12/11/2020, but after this day ecommerce data in GA are set to zero and don't match up with Shopify orders.

 

I have already checked if some errors occur in the dev tool console, but nothing there.

 

What can I do? Hope someone could help me.

 

Beatrice

 

 

kub
Pathfinder
118 2 43

I examined my code and there was old code from removed apps still there. They caused a malfunction. Since then it is working again. The only thing is that it is not tracking like shopify is tracking but i think this is not a problem from shopify or google.

kub
Pathfinder
118 2 43

Thanks @JoesIdeas it was code remained from an app actually installed !! i commented all out from theme.liquid which was not by default. Now i uninstalled the app and reinstalled it (unfortunaltely i lost all data stored from this app).

Strange.

Thanks a lot

JoesIdeas
Shopify Expert
2194 201 587

Ahhh interested. It's common to have leftover app code after uninstall (most apps don't notify their users to give uninstallation instructions... we do though haha). We optimize Shopify sites and this is such a common occurrence we have a service to fix it (called App Analysis).

Sounds like you identified the problem and fixed it, good job!

By the way the console warning you shared can be ignored. Only red errors are usually relevant for site issues.

I guess the lesson here is that if you "delete" an app from your app list, make sure there isn't any leftover theme code. Usually if it's a store facing app or theme related, you'll find app code there.

The challenge developers have is that when you delete an app, that app loses access to your store, so it cannot perform cleanup tasks. The solution we use (for the 2 apps that modify theme code) is to send an email to the store owner automatically when they delete the app, giving them instructions to remove the code.

The IDEAL solution would be for Shopify to set a delay of access removal to like 60 seconds, so the app can execute automated cleanup tasks and remove itself. We've requested this to Shopify but no luck so far.

Glad you solved your issue 👍

 

• Creator of Order Automator (automate tagging, fulfillment, Amazon, notifications + more)
• Shopify developer for 10+ years, store owner for 7 years
• I also make guides like Shopify Automation Tips and How to Deal with Fraud / Chargebacks
kub
Pathfinder
118 2 43

@JoesIdeas yes. Indeed i noticed already before but i am not a coder so i didn't know that these remaining codes can cause a malfunction.

Strange that ithis is not in Shopifys quality policy to force app developers to guarantee the removal and/or informtion to user what to do at uninstall as it seems that shopify is not working.

Should be a must. 

Anyway thanks for bringing me on the right way. Maybe i will try your analyse service in future.

Regards

LeighDoll10
Shopify Partner
3 0 0

Hi there,

We are having a smiliar problem with our storefront. Are you a free lance developer? We're looking for someone to help us fix this problem. Thanks so much

Marek_F
New Member
4 0 0

Hello Kub,

recently we have run into a similar problem, however, I cannot figure out what is wrong in the developer console.

Google Analytics stopped working same as in your example and I cannot see Facebook Pixel work either. When I open Google Tag Assistant, no tags are triggering.

Here is what I found in the console, however, cannot really say which app might be causing the issue.

chrome_8ZwOlkMVfk.png

Web - https://furni-true.com/. 

Many thanks for help.

Marek_F
New Member
4 0 0

Hello Joe,

recently we have run into a similar problem, however, I cannot figure out what is wrong in the developer console.

Google Analytics stopped working same as in Kub´s example and I cannot see Facebook Pixel work either. When I open Google Tag Assistant, no tags are triggering.

Here is what I found in the console, however, cannot really say which app might be causing the issue.

chrome_8ZwOlkMVfk.png

Web - https://furni-true.com/

Many thanks for your help.

kub
Pathfinder
118 2 43
Hi. I solved it by using tags and pasting code in theme.liquid. and after
some time it started working again by its own. Never found out what was the
issue.

Btw you have an liquid error on your menu (you see it on bottom when you
browse b your phone)

May I ask you which theme you are using? It's amazing fast
Marek_F
New Member
4 0 0

Hey,

it is - Shopify wokiee theme. Did you paste Google Analytics tags in the theme.liquid code? I currently have troubles with that, since when I implement Gtag.js code into the theme.liquid, it is not tracking checkout pages.

If you have an idea of how to solve it, I will be grateful.

 

kub
Pathfinder
118 2 43

Yes. I pasted it in my theme.liquid and it worked at that time. My knowledge is not very good in this. Since the EU restrictions on cookies the tracking for me is quite useless