MyBB Community Forums

Full Version: Where To Insert Google Analytics Code?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey all!

First time MyBB user here!

I spent the past ... four, five hours wrestling with MyBB and finally, I've managed to install everything and bar a few minor glitches, it works fine Blush

I'd like to ask a question. Where should I insert the Google Analytics tracker code? I read somewhere it should go into Templates & Style -> Templates ---> Select My Current Template -> Footer Templates -> Footer

My question is, specifically which line should this code go in?

Here's a screenshot to save you the time of trekking through Cpanel -

http://gyazo.com/406086798c6d823b81b84d8a1d47f3c5

Any help would be much appreciated!

Thank you very much Big Grin
in general, we add the new codes at the bottom of the footer template.

some have reported that Google Analytics code added to the footer is not recognized by Google.
in that case, the code needs to be added to bottom of headerinclude template (in ungrouped templates)
(2013-10-12, 02:55 AM).m. Wrote: [ -> ]in general, we add the new codes at the bottom of the footer template.

some have reported that Google Analytics code added to the footer is not recognized by Google.
in that case, the code needs to be added to bottom of headerinclude template (in ungrouped templates)

Thanks for the reply!

Do you know where specifically in the text I should paste the code?

I'm completely new at this
^ you can add the code at the bottom of the template (either footer or headerinclude template)
(2013-10-12, 06:35 PM).m. Wrote: [ -> ]^ you can add the code at the bottom of the template (either footer or headerinclude template)

Here's a screenshot -

http://gyazo.com/c1ef9cfadd88daa9f0c0f3b666aa9128

I placed it right after the last "</script>" .. does it look right?

Also, how long does it take Google to update it? So far it shows Tracker Not Installed.
^ that should work. it can take about 8 hours to 24 hours for Google to update the status.
however, is that a single account or two accounts !?
(2013-10-12, 06:52 PM).m. Wrote: [ -> ]^ that should work. it can take about 8 hours to 24 hours for Google to update the status.
however, is that a single account or two accounts !?

I think it's a Single Google account ... Huh

Thanks for the help pal Smile

I'll update later on tonight to see how it went
^ sorry, it looks like two codes for me. please see Multiple tracking codes & sample code
(2013-10-12, 07:10 PM).m. Wrote: [ -> ]^ sorry, it looks like two codes for me. please see Multiple tracking codes & sample code

Ah I see it. My bad Confused

I read through the links you've given me. It says that I should paste the code just before the </head> tag. I've looked through the code and no where do I see a tag such as this </head>

(2013-10-12, 07:10 PM).m. Wrote: [ -> ]^ sorry, it looks like two codes for me. please see Multiple tracking codes & sample code

Does this look about right?

http://gyazo.com/a49ef37143db9c081efb2613d8ba404b

I placed it right after the last </div>
This is an old thread, I know. . .but;
Google instruction read thusly:
Quote:Create a PHP file named "analyticstracking.php" with the code above and include it on each PHP template page. Then, add the following line to each template page immediately after the opening <body> tag:
<?php include_once("analyticstracking.php") ?>
("code above" refers to the tracking code script that google provides)

This suggests that one would open a template and insert the "include" right after the body tag.
Is this not so?