You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
I posted the Google Analytics code to the skin.php file but it does not work. Anyone know what the problem can be?
Offline
I'm sorry but you haven't given us enough information to try and help or even guess. Would you please post either a link to the page where you're trying it or a copy of what you've tried?
Offline
Thanks for the reply. This is the page I posted the code to: ftp://foldingbed.net/httpdocs/khxc/skin … o/skin.php
Copy of the page:
<?php /* PHP FUNCTION */ /* REQUIRED: Skin startup */ $skinfunc =& $this->include_skinfunc('KHXC_SkinFunc'); extract($skinfunc->startup()); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-767321-4"; urchinTracker(); </script> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> <meta name="keywords" content="<?php print $metakeywords; ?>" /> <meta name="description" content="<?php print $metadesc; ?>" /> <meta name="robots" content="index,follow" /> <base href="<?php print $disp_baseurl; ?>" /> <?php /* PHP FUNCTION */ /* REQUIRED: Prints lightbox code */ $skinfunc->lightbox(); ?> <link rel="stylesheet" type="text/css" media="all" href="skins/ClickCartPro/css/all.css" /> <script type="text/javascript" src="skins/ClickCartPro/scripts/scripts.js"></script> <title><?php print $metatitle; ?></title> </head> <?php /* PHP FUNCTION */ /* REQUIRED: Prints the body tag */ $skinfunc->bodytag(); ?> <div id="skin_wrapper"> <table id="skin_ct"> <tr> <td id="skin_ct_lcol_head"> <a href="<?php print $link_home; ?>" title="Home"><img src="skins/ClickCartPro/media/logo.png" alt="Home" width="169" height="24" /></a> </td> <td id="skin_ct_rcol_head" colspan="2"> <div id="skin_menu_head"> <ul> <li><a href="<?php print $link_home; ?>" title="Home">Home</a></li> <li><a href="<?php print $link_cart; ?>" title="Shopping Cart">Shopping Cart</a></li> <li><a href="<?php print $link_checkout; ?>" title="Checkout">Checkout</a></li> <li><a href="<?php print $link_account; ?>" title="Your Account">Your Account</a></li> <li><a href="<?php print $link_contact; ?>" title="Contact">Contact</a></li> </ul> </div> <div id="skin_headacct"> <?php /* PHP FUNCTION */ /* Include the miniacctlogin namespace to print */ /* either a quick login info. */ $skinfunc->namespace($app_id,'miniacctlogin'); ?> </div> </td> </tr> <tr> <td id="skin_ct_lcol"> <?php /* PHP FUNCTION */ /* Include the frontend menus namespace. Pass LEFT */ /* as the menu id here. */ $skinfunc->namespace($app_id,'femenus','LEFT'); ?> <div class="skin_fenavh">Quick Store Search</div> <div class="skin_fenavmini"> <?php /* PHP FUNCTION */ /* Include the minisearch namespace. */ $skinfunc->namespace($app_id,'minisearch'); ?> </div> <div class="skin_fenavh">Shopping Cart</div> <div class="skin_fenavmini"> <?php /* PHP FUNCTION */ /* Include the minicart namespace. */ $skinfunc->namespace($app_id,'minicart'); ?> </div> </td> <td id="skin_ct_mcol"> <?php /* PHP FUNCTION */ /* Prints the page title. */ $skinfunc->titletag($disp_title); ?> <div id="skin_content"> <?php /* PHP FUNCTION */ /* REQUIRED: Print the content for the page. Do not */ /* remove this function call. Doing so will result in */ /* blank pages being generated. */ $skinfunc->content(); ?> </div> </td> <td id="skin_ct_rcol"> <?php /* PHP FUNCTION */ /* Include the frontend menus namespace. Pass RIGHT */ /* as the menu id here. */ $skinfunc->namespace($app_id,'femenus','RIGHT'); ?> </td> </tr> </table> <div id="skin_footer"> <?php /* PHP FUNCTION */ /* Print the application owner's address and phone */ /* numbers here. */ $skinfunc->printaddphone(); ?> <p>© <?php print $disp_year . ' ' . $site_name; ?>. All rights reserved worldwide.</p> <p> <a href="https://kryptronic.com/" title="Kryptronic"><img src="media/khxc/powered_khxc.png" alt="KHXC Powered" width="79" height="24" /></a> <img src="media/khxc/valid-xhtml10.png" alt="Valid XHTML" width="79" height="24" /> <img src="media/khxc/valid-css.png" alt="Valid CSS" width="79" height="24" /></p> </div> </div> <?php /* PHP FUNCTION */ /* REQUIRED: Run the debug and closure function. */ $skinfunc->debug(); ?> </body> </html>
Offline
The instructions for the tracking urchin say to place it right before the body closing tag. You have it in the header of the page. Try moving it from where you have it now to here (which is the very bottom of skin.php):
</div> <?php /* PHP FUNCTION */ /* REQUIRED: Run the debug and closure function. */ $skinfunc->debug(); ?> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-767321-4"; urchinTracker(); </script> </body> </html>
It will take up to 24 hours to know for sure whether or not the urchin is working.
BTW, the link you posted is a password protected FTP link so you may not want to leave it there.
Offline
Once you've done that log into Google Analytics and have it check the status. It will tell you whether or not you've got things in the right place and with the right number.
Offline
Hi,
I posted as per your suggestion but it still does not work. Anything else i can do?
<?php /* PHP FUNCTION */
/* REQUIRED: Skin startup */
$skinfunc =& $this->include_skinfunc('KHXC_SkinFunc');
extract($skinfunc->startup()); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<meta name="keywords" content="<?php print $metakeywords; ?>" />
<meta name="description" content="<?php print $metadesc; ?>" />
<meta name="robots" content="index,follow" />
<base href="<?php print $disp_baseurl; ?>" />
<?php /* PHP FUNCTION */
/* REQUIRED: Prints lightbox code */
$skinfunc->lightbox(); ?>
<link rel="stylesheet" type="text/css" media="all" href="skins/ClickCartPro/css/all.css" />
<script type="text/javascript" src="skins/ClickCartPro/scripts/scripts.js"></script>
<title><?php print $metatitle; ?></title>
</head>
<?php /* PHP FUNCTION */
/* REQUIRED: Prints the body tag */
$skinfunc->bodytag(); ?>
<div id="skin_wrapper">
<table id="skin_ct">
<tr>
<td id="skin_ct_lcol_head">
<a href="<?php print $link_home; ?>" title="Home"><img src="skins/ClickCartPro/media/logo.png" alt="Home" width="169" height="24" /></a>
</td>
<td id="skin_ct_rcol_head" colspan="2">
<div id="skin_menu_head">
<ul>
<li><a href="<?php print $link_home; ?>" title="Home">Home</a></li>
<li><a href="<?php print $link_cart; ?>" title="Shopping Cart">Shopping Cart</a></li>
<li><a href="<?php print $link_checkout; ?>" title="Checkout">Checkout</a></li>
<li><a href="<?php print $link_account; ?>" title="Your Account">Your Account</a></li>
<li><a href="<?php print $link_contact; ?>" title="Contact">Contact</a></li>
</ul>
</div>
<div id="skin_headacct">
<?php /* PHP FUNCTION */
/* Include the miniacctlogin namespace to print */
/* either a quick login info. */
$skinfunc->namespace($app_id,'miniacctlogin'); ?>
</div>
</td>
</tr>
<tr>
<td id="skin_ct_lcol">
<?php /* PHP FUNCTION */
/* Include the frontend menus namespace. Pass LEFT */
/* as the menu id here. */
$skinfunc->namespace($app_id,'femenus','LEFT'); ?>
<div class="skin_fenavh">Quick Store Search</div>
<div class="skin_fenavmini">
<?php /* PHP FUNCTION */
/* Include the minisearch namespace. */
$skinfunc->namespace($app_id,'minisearch'); ?>
</div>
<div class="skin_fenavh">Shopping Cart</div>
<div class="skin_fenavmini">
<?php /* PHP FUNCTION */
/* Include the minicart namespace. */
$skinfunc->namespace($app_id,'minicart'); ?>
</div>
</td>
<td id="skin_ct_mcol">
<?php /* PHP FUNCTION */
/* Prints the page title. */
$skinfunc->titletag($disp_title); ?>
<div id="skin_content">
<?php /* PHP FUNCTION */
/* REQUIRED: Print the content for the page. Do not */
/* remove this function call. Doing so will result in */
/* blank pages being generated. */
$skinfunc->content(); ?>
</div>
</td>
<td id="skin_ct_rcol">
<?php /* PHP FUNCTION */
/* Include the frontend menus namespace. Pass RIGHT */
/* as the menu id here. */
$skinfunc->namespace($app_id,'femenus','RIGHT'); ?>
</td>
</tr>
</table>
<div id="skin_footer">
<?php /* PHP FUNCTION */
/* Print the application owner's address and phone */
/* numbers here. */
$skinfunc->printaddphone(); ?>
<p>© <?php print $disp_year . ' ' . $site_name; ?>. All rights reserved worldwide.</p>
<p>
<a href="https://kryptronic.com/" title="Kryptronic"><img src="media/khxc/powered_khxc.png" alt="KHXC Powered" width="79" height="24" /></a>
<img src="media/khxc/valid-xhtml10.png" alt="Valid XHTML" width="79" height="24" />
<img src="media/khxc/valid-css.png" alt="Valid CSS" width="79" height="24" /></p>
</div>
</div>
<?php /* PHP FUNCTION */
/* REQUIRED: Run the debug and closure function. */
$skinfunc->debug(); ?>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-767321-4";
urchinTracker();
</script>
</body>
</html>
Offline
jonaha wrote:
I posted as per your suggestion but it still does not work. Anything else i can do?
That looks correct and it is in the right place. Did the test through Google indicate that it could not find the code?
Offline
Thanks for the help Dave. This is the message I receive. All of my other sites running ccp5.1 are working properly:
Tracking has not been validated or added to one or more of your Website Profiles
Report data is not being gathered for one or more of your Website Profiles. Please review the Status column in the table below to discover which Website Profiles require action in order to add tracking for gathering report data.
Offline
When you try validating against your new site what is reported?
Offline
Tracking Not Installed (Last checked: 2007-07-05 8:33 AM PST.)
The Google Analytics tracking code has not been detected on your website's home page. For Analytics to function, you or your web administrator must add the code to each page of your website.
Offline
Here is how I implemented Google Analytics in our skin. Right below:
<script type="text/javascript" src="skins/KRYPTRONIC/scripts/scripts.js"></script>
I added:
<?php $current_port = @getenv('SERVER_PORT'); $ssl_port = $this->globals('khxc.port_ssl'); if ($current_port != $ssl_port) { print '<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>'; print '<script type="text/javascript">_uacct = "ACCOUNT_NUMBER_GOES_HERE";urchinTracker();</script>'; } ?>
This runs Google Analytics on all but SSL pages.
Offline
Hi Nick,
The following is what I did but it does not work. Please advise.
<?php /* PHP FUNCTION */
/* REQUIRED: Skin startup */
$skinfunc =& $this->include_skinfunc('KHXC_SkinFunc');
extract($skinfunc->startup()); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<meta name="keywords" content="<?php print $metakeywords; ?>" />
<meta name="description" content="<?php print $metadesc; ?>" />
<meta name="robots" content="index,follow" />
<base href="<?php print $disp_baseurl; ?>" />
<?php /* PHP FUNCTION */
/* REQUIRED: Prints lightbox code */
$skinfunc->lightbox(); ?>
<link rel="stylesheet" type="text/css" media="all" href="skins/ClickCartPro/css/all.css" />
<script type="text/javascript" src="skins/ClickCartPro/scripts/scripts.js"></script>
<title><?php print $metatitle; ?></title>
</head>
<?php /* PHP FUNCTION */
/* REQUIRED: Prints the body tag */
$skinfunc->bodytag(); ?>
<div id="skin_wrapper">
<table id="skin_ct">
<tr>
<td id="skin_ct_lcol_head">
<a href="<?php print $link_home; ?>" title="Home"><img src="skins/ClickCartPro/media/logo.png" alt="Home" width="169" height="24" /></a>
</td>
<td id="skin_ct_rcol_head" colspan="2">
<div id="skin_menu_head">
<ul>
<li><a href="<?php print $link_home; ?>" title="Home">Home</a></li>
<li><a href="<?php print $link_cart; ?>" title="Shopping Cart">Shopping Cart</a></li>
<li><a href="<?php print $link_checkout; ?>" title="Checkout">Checkout</a></li>
<li><a href="<?php print $link_account; ?>" title="Your Account">Your Account</a></li>
<li><a href="<?php print $link_contact; ?>" title="Contact">Contact</a></li>
</ul>
</div>
<div id="skin_headacct">
<?php /* PHP FUNCTION */
/* Include the miniacctlogin namespace to print */
/* either a quick login info. */
$skinfunc->namespace($app_id,'miniacctlogin'); ?>
</div>
</td>
</tr>
<tr>
<td id="skin_ct_lcol">
<?php /* PHP FUNCTION */
/* Include the frontend menus namespace. Pass LEFT */
/* as the menu id here. */
$skinfunc->namespace($app_id,'femenus','LEFT'); ?>
<div class="skin_fenavh">Quick Store Search</div>
<div class="skin_fenavmini">
<?php /* PHP FUNCTION */
/* Include the minisearch namespace. */
$skinfunc->namespace($app_id,'minisearch'); ?>
</div>
<div class="skin_fenavh">Shopping Cart</div>
<div class="skin_fenavmini">
<?php /* PHP FUNCTION */
/* Include the minicart namespace. */
$skinfunc->namespace($app_id,'minicart'); ?>
</div>
</td>
<td id="skin_ct_mcol">
<?php /* PHP FUNCTION */
/* Prints the page title. */
$skinfunc->titletag($disp_title); ?>
<div id="skin_content">
<?php /* PHP FUNCTION */
/* REQUIRED: Print the content for the page. Do not */
/* remove this function call. Doing so will result in */
/* blank pages being generated. */
$skinfunc->content(); ?>
</div>
</td>
<td id="skin_ct_rcol">
<?php /* PHP FUNCTION */
/* Include the frontend menus namespace. Pass RIGHT */
/* as the menu id here. */
$skinfunc->namespace($app_id,'femenus','RIGHT'); ?>
</td>
</tr>
</table>
<div id="skin_footer">
<?php /* PHP FUNCTION */
/* Print the application owner's address and phone */
/* numbers here. */
$skinfunc->printaddphone(); ?>
<p>© <?php print $disp_year . ' ' . $site_name; ?>. All rights reserved worldwide.</p>
<p>
<a href="https://kryptronic.com/" title="Kryptronic"><img src="media/khxc/powered_khxc.png" alt="KHXC Powered" width="79" height="24" /></a>
<img src="media/khxc/valid-xhtml10.png" alt="Valid XHTML" width="79" height="24" />
<img src="media/khxc/valid-css.png" alt="Valid CSS" width="79" height="24" /></p>
</div>
</div>
<?php /* PHP FUNCTION */
/* REQUIRED: Run the debug and closure function. */
$skinfunc->debug(); ?>
<script type="text/javascript" src="skins/KRYPTRONIC/scripts/scripts.js"></script>
<?php
$current_port = @getenv('SERVER_PORT');
$ssl_port = $this->globals('khxc.port_ssl');
if ($current_port != $ssl_port) {
print '<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>';
print '<script type="text/javascript">_uacct = "UA-767321-4";urchinTracker();</script>';
} ?>
</body>
</html>
Offline
i want to do this as well, can i please ask where is the skin.php under ftp folder please? as i saw couple skin.php in the different folders, which one is the right one i should install the code please. heaps thanks
Offline
webmaster wrote:
Here is how I implemented Google Analytics in our skin. Right below:
Code:
<script type="text/javascript" src="skins/KRYPTRONIC/scripts/scripts.js"></script>I added:
Code:
<?php $current_port = @getenv('SERVER_PORT'); $ssl_port = $this->globals('khxc.port_ssl'); if ($current_port != $ssl_port) { print '<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>'; print '<script type="text/javascript">_uacct = "ACCOUNT_NUMBER_GOES_HERE";urchinTracker();</script>'; } ?>This runs Google Analytics on all but SSL pages.
So, how do we run google analytics on SSL pages? I tried their new code but it gives javascript error and workarounds from forums doesn't help.
James...
Offline