How can I add my Google Tracking code if I am getting an error?

"The formatting is incorrect. Try clearing the code, then copy and paste again". Appreciate any help on this. Thanks!

 

Code from Google:

 

<!-- Google tag (gtag.js) -->

<script async src="https://www.googletagmanager.com/gtag/js?id=G-PYBSQ72Y3N"></script>

<script>

  window.dataLayer = window.dataLayer || [];

  function gtag(){dataLayer.push(arguments);}

  gtag('js', new Date());

 

  gtag('config', 'G-PYBSQ72Y3N');

</script>

 

The title of this post has been edited from the original: "Trying to add Google Tracking code and keep getting "The formatting is incorrect"

1,011 Views
Message 1 of 3
Report
1 Solution
Square Champion

Solution

Hi @AlphaHD.  Where in Square Online are you trying to add this code?  I ask because since most trackers require the code to be in your site’s header HTML, you’ll need to use to use a specific setting in Square.  Go to your dashboard > Online > Settings > Tracking Tools.  At that page, you can just enter your tracking ID “G-xxxxxxxx” and Square will handle the rest.

 

Here’s a link to Square’s Help document on Custom Tracking Code.

Chip A.
Square Expert & Innovator and member of the Square Champions group. (But NOT a Square employee, just a seller like you)

Was my post helpful? Take a moment to mark it as a solution. Marked solutions help other sellers find possible resolutions to similar problems. Also, if you find your solution elsewhere (say, through Support), it is helpful to come back to your post and tell us about it, then mark that as a Solution. Solutions are what this Community is all about!

View Solution >

989 Views
Message 2 of 3
Report
2 REPLIES 2
Square Champion

Solution

Hi @AlphaHD.  Where in Square Online are you trying to add this code?  I ask because since most trackers require the code to be in your site’s header HTML, you’ll need to use to use a specific setting in Square.  Go to your dashboard > Online > Settings > Tracking Tools.  At that page, you can just enter your tracking ID “G-xxxxxxxx” and Square will handle the rest.

 

Here’s a link to Square’s Help document on Custom Tracking Code.

Chip A.
Square Expert & Innovator and member of the Square Champions group. (But NOT a Square employee, just a seller like you)

Was my post helpful? Take a moment to mark it as a solution. Marked solutions help other sellers find possible resolutions to similar problems. Also, if you find your solution elsewhere (say, through Support), it is helpful to come back to your post and tell us about it, then mark that as a Solution. Solutions are what this Community is all about!
990 Views
Message 2 of 3
Report

Thanks much for your reply.  I added the tracking ID earlier as you described. There is an area after that: "Google Verification" where I have the issue. I have rechecked the tracking box and the G code has turned into "google-site-verification=FwcVpfhBwc1L78-hJ-ypvdcqhs_kEVjuhgEUhVs6ig0" so it appears you are correct!

965 Views
Message 3 of 3
Report