Google analytics ecommerce tracking stopped after app installing and uninstalling

Solved
kub
Pathfinder
88 2 27

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

0 Likes
JoesIdeas
Shopify Expert
1310 118 341

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!

Founder of Speed Boostr (Shopify optimization experts, theme customization, custom app development).
Creator of Shopify Analyzer (first performance analysis tool for Shopify sites, free for the Shopify community).
Creator of Order Automator (auto tag orders and customers + auto fulfillment + more automations).
More apps: Theme Scientist (A/B testing), Tip Jar (add a tip button), File Optimizer (optimize CSS, JS, Liquid).
0 Likes
kub
Pathfinder
88 2 27

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. 

0 Likes
kub
Pathfinder
88 2 27

Screenshot_20201225_005019.png

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

0 Likes
kub
Pathfinder
88 2 27

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

0 Likes
JoesIdeas
Shopify Expert
1310 118 341

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

 

Founder of Speed Boostr (Shopify optimization experts, theme customization, custom app development).
Creator of Shopify Analyzer (first performance analysis tool for Shopify sites, free for the Shopify community).
Creator of Order Automator (auto tag orders and customers + auto fulfillment + more automations).
More apps: Theme Scientist (A/B testing), Tip Jar (add a tip button), File Optimizer (optimize CSS, JS, Liquid).
0 Likes
kub
Pathfinder
88 2 27

@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

BeatriceRossi
New Member
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

 

 

0 Likes
kub
Pathfinder
88 2 27

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.

0 Likes