Advertisement:

Author Topic: Google Analytics  (Read 36246 times)

Offline forumposters

  • Jr. Member
  • **
  • Posts: 115
    • Forum Posters
Google Analytics
« on: June 09, 2006, 01:43:23 PM »
SMF Version: SMF 1.1 RC2
What would be a good file to place Google Analytics code in so that it loads on everypage?

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,868
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Google Analytics
« Reply #1 on: June 09, 2006, 01:51:25 PM »
Put it right before the </body> tag in index.template.php. You'll have to do this for every theme, but it will load on ever page.
Michael Eshom
Cincy Space - now open!

Offline Niteblade

  • Full Member
  • ***
  • Posts: 662
  • Gender: Male
    • Prosperent Ads
Re: Google Analytics
« Reply #2 on: June 09, 2006, 05:18:25 PM »
Personally, I put the code inside a javascript / html block in Tiny portal. It's been working fine there. I also put it inside my 'shop' .

Analytics is cool.
affiliate blog

Offline forumposters

  • Jr. Member
  • **
  • Posts: 115
    • Forum Posters
Re: Google Analytics
« Reply #3 on: June 09, 2006, 06:00:35 PM »
How long does it take for analytics to update?  I've had the code there for hours and I see no stats yet.

Offline Niteblade

  • Full Member
  • ***
  • Posts: 662
  • Gender: Male
    • Prosperent Ads
Re: Google Analytics
« Reply #4 on: June 09, 2006, 10:12:39 PM »
Give it at least one day to begin gathering information.

And you'll see all kinds of little dots over your map. :)
affiliate blog

Offline efbl

  • Newbie
  • *
  • Posts: 2
Re: Google Analytics
« Reply #5 on: December 16, 2007, 11:34:50 AM »
Hello,

I have problem with Google Analytics tracker, the forum returns me an error when I reload it.

I use SMF 1.1.4 and Blue Blaze theme.
Code: [Select]
// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;', $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>

<script type="text/javascript">
[ * * * Google script * * * ]
</script>


</body></html>';


Offline Harro

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,122
  • Gender: Male
  • I'm watching you
Re: Google Analytics
« Reply #6 on: December 16, 2007, 04:42:33 PM »
Make sure that all singles quote (') in the google script part have a \ before them.
Should work fine then :)

Offline efbl

  • Newbie
  • *
  • Posts: 2
Re: Google Analytics
« Reply #7 on: December 20, 2007, 07:43:31 AM »
Tracking code installed. Thank you, Harro!

Offline foge

  • Newbie
  • *
  • Posts: 9
Re: Google Analytics
« Reply #8 on: January 19, 2008, 05:25:00 AM »
Make sure that all singles quote (') in the google script part have a \ before them.
Should work fine then :)

What a coincidence - I desperately needed this information just when SMF server got this meltdown. I found numbers of solutions which weren't working. I even searched pages where I couldn't read anything else than these scripts, Arabic, Asian languages, what ever. Internal search is still not working here, but I found this with google search and after trying to do this three days and then see how simple solution there is, makes me wanna scream :) Thx Harro!

Offline jarhaa

  • Semi-Newbie
  • *
  • Posts: 14
  • Gender: Male
    • Project Normandy 2010
Re: Google Analytics
« Reply #9 on: June 08, 2008, 01:36:22 PM »
I tried this solution too but it didn't help. I am using "SlickPro" theme from metalcore.
Should I put that slash before EVERY (')   ?

Edit. I got it working... Needs to be JUST before </body>   :-\
« Last Edit: June 08, 2008, 01:48:01 PM by jarhaa »

Offline ApplianceJunk

  • SMF Hero
  • ******
  • Posts: 3,483
    • ApplianceJunk.com
Re: Google Analytics
« Reply #10 on: June 09, 2008, 02:14:12 PM »
Personally, I put the code inside a javascript / html block in Tiny portal. It's been working fine there. I also put it inside my 'shop' .

Analytics is cool.

Good idea with the TP block.

Offline brygida

  • Semi-Newbie
  • *
  • Posts: 17
Re: Google Analytics
« Reply #11 on: June 11, 2008, 05:41:14 PM »
Thank you Harro!

for me also \ before (') worked 
at second time  :) the first i have missed one O:)

Offline Lautermilch

  • Semi-Newbie
  • *
  • Posts: 79
    • Swindled For Jesus
Re: Google Analytics
« Reply #12 on: August 10, 2009, 11:14:34 PM »

I get this error code:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in .../Themes/BlackRainV2118/index.template.php on line 178
169:
170:             current_header_ic = mode;
171:          }
172:       // ]]></script>
173: </head>
174:
175:
176: <script type="text/javascript">
177: var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
178: document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
179: </script>
180: <script type="text/javascript">
181: try {
182: var pageTracker = _gat._getTracker("UA-9788839-1");

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,388
    • StoryBB/StoryBB on GitHub
Re: Google Analytics
« Reply #13 on: August 11, 2009, 05:31:35 PM »
Can we have some lines before that too?
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline iamekim

  • Newbie
  • *
  • Posts: 5
Re: Google Analytics
« Reply #14 on: September 04, 2009, 02:46:05 PM »
Make sure that all singles quote (') in the google script part have a \ before them.
Should work fine then :)

so much help. thank you Harro. :)

Offline dgswilson

  • Newbie
  • *
  • Posts: 6
Re: Google Analytics Code
« Reply #15 on: September 16, 2009, 08:14:23 AM »
Yes, (\') was missing component. And yes - All.  Thanks a lot. What is, or maybe where is, "Tiny Portal"?

hxxp:www.dgswilson.com/index.php [nonactive]
« Last Edit: September 16, 2009, 08:17:39 AM by dgswilson »

Offline sadiakomal

  • Semi-Newbie
  • *
  • Posts: 34
    • Get Designs
Re: Google Analytics
« Reply #16 on: March 03, 2010, 04:55:00 PM »
when i try to past the code in index.template, its shows error and i have uploaded theme again i am using CS classic them "islamabadcommunity.com"

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,388
    • StoryBB/StoryBB on GitHub
Re: Google Analytics
« Reply #17 on: March 04, 2010, 05:05:58 PM »
sadiakomal, please attach your index.template.php file. Did you attempt to use the mod mentioned earlier in this thread or not?
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline rostamiani

  • Semi-Newbie
  • *
  • Posts: 35
  • Gender: Male
    • آریا پدیا
Re: Google Analytics
« Reply #18 on: November 21, 2010, 06:59:59 PM »

Offline ronaldguilmet

  • Semi-Newbie
  • *
  • Posts: 13
Re: Google Analytics
« Reply #19 on: February 23, 2012, 05:20:37 AM »
SMF Version: SMF 1.1 RC2
What would be a good file to place Google Analytics code in so that it loads on everypage?

just use this mod http://custom.simplemachines.org/mods/index.php?mod=351 and copy and past your code into the header. no code hacking required. worked great for me.