Community Forum

Please read the intro before joining/posting. Thank you.

If you have questions about our software, chances are this forum has the answers.

You'll need to register before you can post on the forum to ask your question or to answer another one. A reply will be posted to each and every question that is asked so there is no need to double post or bump your post. We'll do our best to answer promptly, but in some cases it may take a day or two. If you bump your post, it may be removed. Bear with us and we'll get your question answered quickly.

Here are a few tips to help you to get your questions answered more rapidly.

IMPORTANT: Posts in English only. We don't employ translators and we'll be unable to understand your message properly and will probably delete it.
SOFTWARE: Each software has it's own forum. Software here is NOT supported. Posts about this software will be deleted. Supported software questions ONLY please.
SEARCH: Use the search option to see if your question has been answered on the forum before now or if there is an answer in the documentation of your software.
PERSONAL SUPPORT: If you have purchased a commercial version of any software, using the contact option at the licence centre ensures a faster response.
AUTO DELETION: Accounts older than 5 days, with no posts or topics, are automatically deleted. Only register if you are thinking of posting.
LINKS: Any links posted are not clickable (to deter spammers) and must be copied / pasted into your browser address bar.


You are not logged in.

Google analytics codes etcPosts in the Maian Greetings forum by bphupscher
07-12-2017 00:27:16


In my 2.1 installation, i had some tracking codes (javascript I think) That worked for google analytics, piwik and "chcounter". the google and chcounter i would like to have working properly in the new website..
I had put them in footer.tpl.php in 2.1 site

Anyone know if there a place where I should best try to put these codes?

The codes also try to get the (SEO) url and page title too for the counter(s)

// <![CDATA[
// chCounter
// settings:
cstatus = "active";
visible = "1";
page_title = "<?php echo $this->TITLE; ?>";
url_of_counter_file = "";

page_url = unescape( location.href );
referrer = ( document.referrer ) ? document.referrer : "";
page_title = ( page_title.length == 0 ) ? document.title : page_title;
document.write( "<script type=\"text/javascript\" src=\"" );
document.write( url_of_counter_file + "?chCounter_mode=js&amp;jscode_version=3.1.3&amp;status=" + cstatus + "&amp;visible=" + visible + "&amp;page_title=" + encodeURIComponent( page_title ) );
document.write( "&amp;page_url=" + encodeURIComponent( page_url ) + "&amp;referrer=" + encodeURIComponent( referrer ) + "&amp;res_width=" + screen.width + "&amp;res_height=" + screen.height + "\"><" + "/script>" );
// ]]>
 <object data="" type="text/html"></object>
        <td align="center" valign="top" style="border-top:1px solid #68A7DA;border-bottom:1px solid #68A7DA;padding:5px;"  class="header">

<!-- Piwik -->
<a href="" title="Web analytics" onclick=";return(false);">
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "" : "");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
<script type="text/javascript">
piwik_action_name = document.title;
piwik_idsite = 1;
piwik_url = pkBaseURL + "piwik.php";
piwik_log(piwik_action_name, piwik_idsite, piwik_url);
<noscript><p>Web analytics <img src="" style="border:0" alt="piwik"/></p>
<!-- /Piwik --> 

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "' type='text/javascript'%3E%3C/script%3E"));

<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-*********-**");

22-12-2017 17:35:14

Thank you, it works.
(I had to update a bit in this script to get it working again, <?php echo $this->TITLE; ?> to get the title to my counter had to be changed (which I found the correct format in header tpl smile )

100% Free SoftwareSoftware Versions, Development, Docs & UpgradesHostingNewsletter
Made with in the U.K & Hong Kong

Free PHP Scripts / Responsive PHP Scripts / Lightweight PHP Scripts / White Label PHP Scripts