Jump to content
TNG Community

Statcounter in footer.php


dennis800121

Recommended Posts

dennis800121

Help!!

I would love to have a visit counter on my page. I have been using googles analytics but i dont like it.
I found statcounters counter and got the code that i want to put in the footer.php but the code is in HTML and not PHP.
How do i solve this? I just want a counter on the bottom on my page :(

The code i got from statcounter is this:

#####################################################
<!-- Start of StatCounter Code for WordPress (either .com or .org) -->
<script type="text/javascript">
var sc_project=10544563;
var sc_invisible=0;
var sc_security="b635080d";
var scJsHost = (("https:" == document.location.protocol) ?
"https://secure." : "http://www.");
document.write("<sc"+"ript type='text/javascript' src='" + scJsHost+
"statcounter.com/counter/counter.js'></"+"script>");
</script>
<noscript><div class="statcounter"><a title="shopify analytics ecommerce
tracking" href="http://statcounter.com/shopify/" target="_blank"><img
class="statcounter" src="http://c.statcounter.com/10544563/0/b635080d/0/"
alt="shopify analytics ecommerce tracking"></a></div></noscript>
<!-- End of StatCounter Code for WordPress (either .com or .org) -->

#####################################################

Please, can someone help me!

Link to comment
Share on other sites

How did it work if the counter didn't show in the footer?

It should be inserted before

	    </td>
	</tr>
</table>

At the end of the footer.php. That's where it is on my template8 site.

Link to comment
Share on other sites

  • 3 weeks later...
Robert Newman

I am using template 12, I have added a counter by following your replies above but not in the footer. I couldn't see how to enter it in the footer, any ideas please

Link to comment
Share on other sites

I am using template 12, I have added a counter by following your replies above but not in the footer. I couldn't see how to enter it in the footer, any ideas please

​In the Template12 footer.php, you need to add the StatCounter code immediately after the following:

							<?php
								$flags['basicfooter'] = true;
								echo tng_footer($flags);
							?>

 

Link to comment
Share on other sites

  • 8 years later...
Jon @ HPx

I have used StatCounter on different sites in the past. I would like to add it to my tng site, template 21. I've followed the suggestions in this thread, but the counter doesn't seem to work. I've added it to both the footer.php that comes with the basic install and the footer.php in the template folder. (Not quite sure yet which one is the one that is active.🙂) So I must be missing something or doing something wrong.

Help, please.

TIA

 

Link to comment
Share on other sites

Jon @ HPx

On further testing, I have found it does count (unless the browser blocks the tracker) but it isn't visible. I'm okay with it not being visible, but I will continue to work on it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...