Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
Pages: 1
Hello,
Can I use StatCounter in my TTG site?
If yes, please tell me how.
http://www.statcounter.com
Thanks
Gene
Offline
You should be able to inject whatever code they'd like you to paste into the page via PHPlugins. You can see documentation on how to do this.
Offline
I have PHPlugins installed.
Where can I find the documentation on how to install?
Offline
phplugins documentation is near the bottom of the main Documentation page:
http://ce4.theturninggate.net/docs/doku … bility_api
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
When I embed the Statcounter code into the Phplugins doc and upload to my site the home page does not show.
Is there a specific area (line) of the file that I should insert the code?
Thanks
Gene
Offline
Please post a copy of your code so we can help you get it working.
Daniel Leu | Photography
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com
Offline
Where do the Statcounter documents tell you to put the code? That will determine which hook function to use. You can see the list of hook locations and how they work in the phplugins documentation.
http://ce4.theturninggate.net/docs/doku … _functions
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Here is the code for StatCounter.
<!-- Start of StatCounter Code for Default Guide -->
<script type="text/javascript">
var sc_project=10687930;
var sc_invisible=0;
var sc_security="7ca145a0";
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" href="http://statcounter.com/shopify/"
target="_blank"><img class="statcounter"
src="http://c.statcounter.com/10687930/0/7ca145a0/0/"
alt="shopify analytics"></a></div></noscript>
<!-- End of StatCounter Code for Default Guide -->
Offline
ok. Where do they say it needs to go? In the body of the page? in the <head> tag? The footer?
wherever that is will determine which hook to use.
does this need to go in every page? Just the home page?
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
They ask the code to be placed "just inside the closing "body" tag - </body>".
Just the home page. I just want to know when someone visits the site.(# per day, wk, mo.)
Thanks
Offline
ok, try using this:
//Add StatCounter
function ttg_body_bottom( $style, $path ) {
if (G_STYLE== 'CE4-PAGES-HOME' ){
echo'
<!-- Start of StatCounter Code for Default Guide -->
<script type="text/javascript">
var sc_project=10687930;
var sc_invisible=0;
var sc_security="7ca145a0";
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" href="http://statcounter.com/shopify/"
target="_blank"><img class="statcounter"
src="http://c.statcounter.com/10687930/0/7ca145a0/0/"
alt="shopify analytics"></a></div></noscript>
<!-- End of StatCounter Code for Default Guide -->
';
}
}
//END
this assumes you're using the regular CE4 Pages home page and are not replacing it via Publisher. If you are replacing the home page with a Publisher controlled album, then there will need to be a slight change.
you'll notice that I altered the code some. I added escape characters ( \ ) prior to any single quotes. This is because single quotes would close the echo statement and mess things up.
Place the above code in the USER FUNCTIONS area of the phplugins.php file
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Pages: 1