Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Tracking hits on the forum
Avatar
Paul Smith
Member
sp_UserOfflineSmall Offline
Feb 3, 2013 - 2:57 pm

I need to add the following code to my site to track hits so that my site can be displayed on another site which ranks all sites in my niche according to popularity. I currently have the code in a Wordpress widget but hits on my forum aren't being tracked. This is affecting my ranking.

I have looked in the help section on the site that displays the ranking about found the following comment...

"Please place only one copy of the image code on each page. If you are using Blogger, Wordpress, or something of that ilk, place it on the page template."

Where do I find the page template and is there any particular part of the template where the following code should be added?

<a href="http://www.ukwrs.co.uk/index.php?id=788"><img src="http://www.ukwrs.co.uk/button.php?id=788"></a>

The forum is here...

http://livingonanarrowboat.co.uk/forum/

Avatar
Brandon
U.S.
SP Wrangler
Free Members
sp_UserOfflineSmall Offline
Feb 3, 2013 - 10:32 pm

Since the SP header and footer are used on every page I would put it in one of those. Probably the footer file spFoot.php toward the bottom.

You can echo it like this.

echo '<a href="http://www.ukwrs.co.uk/index.php?id=788"><img src="http://www.ukwrs.co.uk/button.php?id=788"></a>';
Avatar
Paul Smith
Member
sp_UserOfflineSmall Offline
Feb 3, 2013 - 11:33 pm

Sorry for being a bit of a dimwit, but where do I find the spFoot.php file? Is it just a case of pasting the above code into it?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 4, 2013 - 5:13 am

You need to be a little careful here. The instruction is actually referring to your WordPress template and this begs the question - have you already used this code for the rest of your site and, if so, where did you put it?

If you want it to count ALL pages of your site - not just the forum views - then it really needs to be placed in your WordPress theme. If you ONLY want to count forum page views then placing it in the forum template - as Brandon suggested above - will be fine.

If the former - then I would suggest the footer.php file in your WP theme and you can edit this in the WP Admin > Themes >Editor.

If the latter then yes - use the spFoot.php which can be found in the /templates folder of the Simple:Press theme you are using and can be edited using the SP theme editor under forum admin > Themes.

I would recommend the former so that you actually track hits to ALL pages on your site. But if you opt for just the forum then as always we recommend that you create your own SP theme so that any customisation is not lost during a future update. (http://codex.simple-press.com/.....g-a-theme/)

andy-signature.png
YELLOW
SWORDFISH
Avatar
Paul Smith
Member
sp_UserOfflineSmall Offline
Feb 4, 2013 - 9:37 am

Great information. Thanks for that. I want to track all hits on the site, not just the forum, so I now need to find out how to add the code to the Thesis theme footer. Thank you.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 4, 2013 - 11:28 am

Well - if you put it within a php code block then as Brandon had it above should work. If outside a php code block - i.e., in an HTML block then remove the echo and the starting and ending quotes.

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625