how to add analytics code into smf

Started by zockloros, April 17, 2007, 02:09:54 AM

Previous topic - Next topic

zockloros

title pretty much says it.

help is very much appreciated  :)

metallica48423

well, you could search index.template.php for theme_copyright(); and add it in its own <tr> below that, that would show it at the bottom of your page
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

KGIII

I inserted mine with either the Global Headers and Footers mod or with the Ad Management mod to be honest. I prefer the latter:

Ad Management mod:
http://custom.simplemachines.org/mods/index.php?mod=255

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Harro

Analytics code should go just before </body>.
So just open index.template.php and search for </body> and paste it there :)

KGIII

Harro: Are you sure? I will believe you BUT when I tried this I ended up with some rather funky errors _if_ I recall correctly?

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Harro

Worked fine for me.
Code has been there since june without any problems.
And if you want proof:
<div id="ajax_in_progress" style="display: none;">Loading...</div>

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "xx-xxxxxx-x";
urchinTracker();
</script>
</body></html>


;)

KGIII

pfft... Like I'd doubt you? Come on now? :P I wonder what I missed when trying to load it or get it to load? I'd sooner doubt my ham-fisted approach than to really doubt you? Thus the "I will believe you" bit. ;)

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Harro

Well, your approach also works ;)
But for such things I preffer to do it manually though. Don't have to worry about mod compatability, updating mods, reinstallations,...

KGIII

Well, given my understanding of your abilities and appreciation for your contributions? I am gonna have to be honest and say that, frankly, I didn't even bother testing your response again - for a billionth time. These days I just use a mod. I suspect that the efforts I made to insert it manually were FUBARed by PBKAC actually and likely missing semi-colons or what not.

Back to the original question here. For just a moment. (I love digression as that is what makes the communication in a community.)

This is why I tend to recommend making MILD edits to the default/core theme to get the desired layout. This makes updating/upgrading easier and HOPEFULLY will result in more people upgrading SMF to cover security issues. I try, very hard, to avoid manual whenever I can.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Advertisement: