Comic Fury Webcomic Hosting - Google Analytics, where to put the code?

You are not logged in. Log in, Register, More info
Forum > Layouts, HTML, CSS & Javascript > Google Analytics, where to put the code?
Pages: [1]

"Google Analytics, where to put the code?", 21st Nov 2017, 12:46 PM #1
Moonsun

User avatar
Posts: 16
Registration date: 14th Nov 2017
I used the search filter and found no match so I'm guessing no one struggled with this...
So I tried putting this:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-109850174-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-109850174-1');
</script>

inside the <head> of the "Overall" HTML but it's been 48 hours and I have nothing.
So can anyone tell me what I did wrong please?

And also, am I supposed to put it on every page?

Thanks!
_______________________
image
21st Nov 2017, 1:51 PM #2
JammyTheBirb
Birb is the Worb
User avatar
Posts: 3436
Registration date: 17th Aug 2012
Location: Englishland
I plonked mine under overall, outside of body right at the end. This works for me. You don't need it on every page.
_______________________
image
21st Nov 2017, 2:38 PM #3
Robotwin.com

User avatar
Posts: 2744
Registration date: 22nd Sep 2010
Location: USA, Milky Way
Maybe this might help:

https://support.google.com/analytics/troubleshooter/7400465

The script should automatically be on every page if you put it in your main
comicfury layout template
21st Nov 2017, 3:07 PM #4
Kyo
family life
User avatar
Posts: 17776
Registration date: 6th Jul 2008
Location: Germany
yeah right before </body> in the overall is best. Also analytics does take a fair bit of time before it starts showing data, so that might just be the problem
_______________________
hello
22nd Nov 2017, 12:50 AM #5
Moonsun

User avatar
Posts: 16
Registration date: 14th Nov 2017
I think it said 24 to 48 hours and I input the code saturday evening.
So you're saying before closing the body? Because on their site, it says before closing the head. I thought it didn't matter as long as it was in the head but I'll try pasting it juste before closing head.
Thanks I'll let you know if it works. Or come back crying if it doesnt...
_______________________
image
22nd Nov 2017, 1:19 AM #6
Magravan
Ma-Ma-Magravan!
User avatar
Posts: 5255
Registration date: 13th Oct 2009
Location: Canada
Kyo's right, we waited several days for ours to start generating data.
_______________________
image
The last human risks life and limb brains to save the intelligent zombies responsible for destroying humanity. Completed 300 page story with 15 page epilogue. PG13
<- Avatar: By Kristy of Wake the Sleepers
22nd Nov 2017, 9:19 AM #7
Moonsun

User avatar
Posts: 16
Registration date: 14th Nov 2017
Ok thanks I'll keep that in mind
_______________________
image
11 days ago, 3:46 AM #8
Moonsun

User avatar
Posts: 16
Registration date: 14th Nov 2017
Hey!
So... I put the code before closing the body one week ago and I still got nothing...
I've looked around on Google and I can't find any help.
Where did you put it in your site?
_______________________
image
11 days ago, 8:38 PM #9
Robotwin.com

User avatar
Posts: 2744
Registration date: 22nd Sep 2010
Location: USA, Milky Way
I put mine in the head just before the closing </head> tag.

You can go to your comic page in one window, and your Google Analytics dashboard real-time report in another, and it should tell you at least 1 person is looking at your site right now.

However, it won't work for visitors that have some kind of ad blocker or privacy software that specifically blocks the googletagmanager.com domain. So that's something to consider.
10 days ago, 4:23 AM #10
Moonsun

User avatar
Posts: 16
Registration date: 14th Nov 2017
I tried testing the real-time report for both </head> and </body> and it doesn't work.
A friend told me to leave my site open for a while and refresh GA here and then as it could take some time to load the real-time but it didn't work either.
And I don't have an adblocker or anything...
What a pain...

Thanks anyway Robotwin, I'll keep looking for a solution :(
_______________________
image
10 days ago, 3:25 PM #11
Magravan
Ma-Ma-Magravan!
User avatar
Posts: 5255
Registration date: 13th Oct 2009
Location: Canada
We put it right after <title> in the header.

Might be helpful if you put your overall layout code in a code box in this thread.
_______________________
image
The last human risks life and limb brains to save the intelligent zombies responsible for destroying humanity. Completed 300 page story with 15 page epilogue. PG13
<- Avatar: By Kristy of Wake the Sleepers
6 days ago, 12:00 AM #12
Moonsun

User avatar
Posts: 16
Registration date: 14th Nov 2017
I finally got it working yesterday by putting the code just below <head>
Still wondering why it didn't work before but all good now!
Thanks for your help guys!
_______________________
image
Forum > Layouts, HTML, CSS & Javascript > Google Analytics, where to put the code?
Pages: [1]