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"

903 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 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 possible "best answer." I hate the term, and wish we could just mark posts as "helpful." But this is our only mechanism at the moment. Just remember "Best answer" should be interpreted as "helpful," and nothing more. LOL. "Best" (ugh) answers help folks possibly find solutions to similar problems they are hoping to solve.

View Best Answer >

881 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 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 possible "best answer." I hate the term, and wish we could just mark posts as "helpful." But this is our only mechanism at the moment. Just remember "Best answer" should be interpreted as "helpful," and nothing more. LOL. "Best" (ugh) answers help folks possibly find solutions to similar problems they are hoping to solve.
882 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!

857 Views
Message 3 of 3
Report