gtag code visible to customers on checkout page

One of the gtag code snippets appears to be visible to our customers on the checkout page:

Here is the code in the of my theme liquid file:

Has anyone ever run into this problem? Any ideas on how to fix?

Thanks so much,

Olga

Hey Olga, can you share a link to your site please?

Does the gtag snippet only show on certain pages or all of them?

www.threadandmaple.com

It only shows on the checkout page…

Sure, it’s www.threadandmaple.com

It only shows on the final checkout success page, after an order has been paid (I had attached a snipped of the screenshot) in my original post there.

Thanks!

Olga

well there’s nothing on the store I’d like to buy so I can’t see the tag, but I dare say if its showing on the checkout page/thankyou page then you should check the checkout section in the settings. If you have any additional code that shows gtag then that’s likely causing the issue.

Oh of course!! There it was! I had just pasted in Additional Scripts in Checkout settings, I didn’t realize I had to put tags around it! That’s why it was just showing up, it wasn’t properly scripted. I thought everything that went into this field was by default inserted within script tags. How obvious in hindsight, thanks so much for your help!