Internet Explorer is not supported. Please upgrade to a more modern browser.
I am running v2-pre6, and am trying to add the Google Analytics gtag.js script to my headers... I found the question asked a while ago here -- https://github.com/NamelessMC/Nameless/issues/1348 -- but when I put the script into my /custom/templates/DefaultRevamp/header.tpl, I get a Smarty Compiler error on the website related to the script. Changing the /Default/header.tpl doesn't do anything.
I assume I'm pasting it into the wrong part of the file -- where should the gtag.js script be added to avoid throwing an error?
Thanks for any help you can give! Apologies in advance if it's a simple fix I overlooked.
Hi,
You're right in saying the Google Analytics script goes into custom/templates/template/header.tpl, but you might need to add {literal} before and {/literal} after the script.
EDIT: My bad, your suggestion fixed it. I forgot I had tracking blockers enabled, tried a different browser on a whim and it worked just fine. Thanks for your help!
That got rid of the Smarty Compiler error, but it still doesn't seem to be tracking. This might be getting more into Google territory now, unless you can think of anything else? I tried both /custom/templates/Default/header.tpl and /custom/templates/DefaultRevamp/header.tpl, neither showed any traffic in Analytics. Here's what I have for the DefaultRevamp header file (ID is blocked out as #####), if you're able to notice anything obviously wrong.
EDIT: Having trouble with the code snippet tool, so here's a Pastebin instead: https://pastebin.com/Km53VCza