Using Invisible Counter with Official StatCounter Plugin for WordPress

WordPress bloggers using StatCounter service to track and count visitors and page views statistics on their blogs can now download and install official WordPess plug-in for StatCounter to easily install StatCounter tracking code on self-hosted on the blog for comprehensive range of web analytic stats.

The StatCounter plugin provides easier way to install tracking code without the need to manually edit and modify the template files or code. However, it also introduces some inflexibilities too, such as to make use of invisible counter. Although it’s possible to customize counter display style to invisible in “Configure Counter” option, but StatCounter sometimes add a StatCounter.com tagline to the web pages with code added even though the counter type is set to invisible in control panel.

To ensure that StatCounter always stay invisible when using Official StatCounter Plugin for WordPress to automatically display the tracking code on all Wordpress blog posts and pages, a specific invisible tag code needed to be added into the tracking code by modifying the plug-in file.

Open StatCounter-Wordpress-Plugin.php in any text editor (if already uploaded to server, remote SSH into the server and change directory to \wp-content\plugins directory). Then go to the bottom of the code, and locate a block of text similar to the following text at around line 197:

<!-- Start of StatCounter Code -->
<script type="text/javascript">
<!--
var sc_project=<?php echo $sc_project; ?>;
var sc_partition=<?php echo $sc_part; ?>;
var sc_security="<?php echo $sc_security; ?>";
//-->
</script>
<script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script>
<!-- End of StatCounter Code -->

Add an additional var line below to in between, or on top or bottom of existing 3 lines:

var sc_invisible=1;

The final code will looks like below:

<!-- Start of StatCounter Code -->
<script type="text/javascript">
<!--
var sc_project=<?php echo $sc_project; ?>;
var sc_invisible=1;
var sc_partition=<?php echo $sc_part; ?>;
var sc_security="<?php echo $sc_security; ?>";
//-->
</script>
<script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script>
<!-- End of StatCounter Code -->

Upload the new plugin file to the server, or if you already editing on the server, save the file. Voila, the StatCounter will now always invisible to visitors’ eyes.

Share and contribute or get technical support and help at My Digital Life Forums.



Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting


Custom Search

New Articles

Incoming Search Terms for the Article

yahoo invisible script - where to put statcounter code for wordpress - statcounter plugin - yahoo invisible php script - "yahoo invisible checker"+php script - http://www.statcounter.com/counter/counter_xhtml.js - messenger plugins for invisible code - wordpress counter statistic - yahoo invisible script download - plugin StatCounter code - invisible code to track viewers - counter_xhtml.js - download plugins invisible - how to config statcounter wordpress plugin - digital life wordpress plugin - statcounter firefox plugin - where to install statcounter code into wordpress - why does stat counter leave lines on my blog - wordpress invisible stat counter - block wordpress counter - my wordpress statcounter is not tracking - php yahoo invisible - wordpress yahoo counter - yahoo invisible code - statcounter firefox - how to install stat counter on wordpress - yahoo invisible detector script - check visible invisible yahoo php script - free script php yahoo invisible - invisible checker php script -