Google Analytics

From PhpCOIN Documentation

Jump to: navigation, search

To configure Google Analytics in your phpCOIN website just follow these simple instructions: - In your theme's core.php file within function do_page_closeout() and immediately before the </body> tag is output, add some code to output the google code. For instance, in /cantex theme starting around line 995 is:

# Add WYSIWYG (if found) to output IF ($tinymce) {$_out .= ;} ELSEIF ($htmlarea) 
 {$_out .= $htmlarea;}

- Close html

$_out .= '</body>'.$_nl;
$_out .= '</html>'.$_nl; 

Immediately before the - Close html line, add something like this: (Check for the latest code from Google)

    $_out .= '<script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." :  
    document.write(unescape("%3Cscript src=\'" + gaJsHost + "\'   
    <script type="text/javascript">
    var pageTracker = _gat._getTracker("UA-xxxxxx-x");

Where you have to replace the xxxxxxx with your Google Analytics Code.

Note that since the string starts and ends with a single apostrophe, any apostrophes within the string must be preceded by a backslash to escape them.

Personal tools

Inscrita el Registro Mercantil de Mallorca Tomo 2140, Hoja No. PM-51034, Folio 135
This website owned and operated by: Technology Services RPVW S.L. CIF# B57345084
Avda Constitucion 48 Bajos Alaro 07340 Baleares SPAIN
Tel:+34 971518362    Fax: +34 971518368    eMail: