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.

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 to comments feature has been disabled. To receive notification of latest comments posted, subscribe to My Digital Life Comments RSS feed or register to receive new comments in daily email digest.

New Articles

Incoming Search Terms for the Article

statcounter script var sc_security - srpski serveri za counter - facebook statcounter - invisible counter js - how do i use statcounter with wordpress - do i need to install code with statcounter using wordpress - hit counter plugin wordpress - hit counter plugin - invisible counter for facebook - free script invisible counter - invisible hit counter - counter-strike plugins invisible - statcounter wordpress free? - var sc_invisible=1 statcounter - can i install a hit counter on facebook - how to set up automatic email log file in statcounter - counter stats wordpress - invisible counter wordpress - digital counter using java script - invisible counter code - invisible stats counter for facebook - using counters on wordpress - statcounter script for wordpress - invisible stat counter wordpress - hiding wordpress hit counter - wordpress statcounter plugin - you are now invisible! counter strike plugin -