x

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"

382 Views
Message 1 of 3
Report
1 Best Answer
Square Champion

Best Answer

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

If my answer resolves your issue, please take a minute to mark it as Best Answer. That helps people who find this thread in the future.

Piper’s Ice Cream Bar, Covington KY USA
Website
Facebook
Click here to see a list of third-party apps I use to add functionality to my Square account!

जो है सो है

View Best Answer >

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

Best Answer

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

If my answer resolves your issue, please take a minute to mark it as Best Answer. That helps people who find this thread in the future.

Piper’s Ice Cream Bar, Covington KY USA
Website
Facebook
Click here to see a list of third-party apps I use to add functionality to my Square account!

जो है सो है
361 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!

336 Views
Message 3 of 3
Report