Google Analytics - Getting error code when I try to post script

hb5
New Member
1 0 0

Thank you!!

0 Likes
ChrisBP
New Member
1 0 0

Hi,

I'm really struggling with this, been trying for hours... Where exactly is this step? Google tag? Google analytics? Shopify? Thanks!

0 Likes
AmongThings
New Member
1 0 0

I have the same error, please help me, i need use Google Analytics 

0 Likes
hbz
New Member
1 0 1

Hello,

For anyone still struggling with this, here are the steps you need to take:

- Go to your analytics dashboard at analytics.google.com

- Click on the bottom left Admin button

 

Screenshot 2020-11-25 at 19.56.38.png

 

 

 

 

 

 

 

 

 

- From there click Create property

- Enter a name for your property (ex. Shopify)

- On the bottom, click Show advanced options

 

Screenshot 2020-11-25 at 19.57.22.png

 

 

 

 

 

 

 

 

 

- Check Create a Universal Analytics property

 

Screenshot 2020-11-25 at 20.04.09.png

 

 

 

 

 

- Enter your website

- You can select the option to create both or just the Universal Analytics (this is the one Shopify needs)

- Hit Next and copy the property the ID that starts with UA-

 

To give a bit more context, Google recently made an update to create by default a Measurement ID  (that starts with G-)instead of a Tracking ID (that starts with UA-). Shopify only accepts the tracking ID at the moment.

 

Hope this helps anyone else!

Shivam840
New Member
3 0 0

When I paste my analytics code starts with G-*******   it shows analytics snippet does not look valid . I tried to paste whole script but it also have same issue. I don't understand my mistake. 

0 Likes
Caresnone
New Member
1 0 0

This worked!  Thank you very very much!

0 Likes
jalalify
New Member
1 0 1

Hey Nick, Thousands of Shopify user unable to install Google Analytics on their Shopify store because of the recent Google Analytics change: Have a look at the recent code: 

 

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

gtag('config', 'G-XXXXXXXXXX);
</script>

 

ABOVE THEY GOOGLE IS NOW GIVING - "G-XXXXXXXXX" which was previously: "UA-XXXXXXXX" ...I think this is the issue by Shopify. Shopify should consider this seriously. Thanks! 

With regards, 

Muhammad

LucasDuque
New Member
1 0 1

The error message is Analytics snippet does not look valid (UA-xxxx-x), so I think that has some validation in the shopify's application back-end and needs to be updated, because Google Analytics is now generate a code in the format G-XXXXXXXXX and no UA-XXXX-X, I'm in 12-2020 and this error is still happening. Fortunately I found a work around to put this in the code of the theme, but can have others persons that don't have this skill.

EricHubbs
New Member
1 0 0

Good catch! Thank you! You saved me from an hour journey of headscratching and contacting support. You were the only one to know what to do! Thank you! It worked. I sure hope they updated it soon. 

0 Likes
CareyA
New Member
2 0 0

Worked perfectly! Thank you so much.

0 Likes