Kryptronic Software Support Forum

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.

#1 07-04-2007 12:05:11

jonaha
Member
Registered: 11-01-2006
Posts: 192

Google Analytics

I posted the Google Analytics code to the skin.php file but it does not work. Anyone know what the problem can be?

Offline

 

#2 07-04-2007 12:27:28

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Google Analytics

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

 

#3 07-04-2007 12:41:16

jonaha
Member
Registered: 11-01-2006
Posts: 192

Re: Google Analytics

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:

Code:

     <?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>&copy; <?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>
&nbsp;
<img src="media/khxc/valid-xhtml10.png" alt="Valid XHTML" width="79" height="24" />
&nbsp;
<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

 

#4 07-04-2007 13:12:19

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Google Analytics

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):

Code:

</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

 

#5 07-04-2007 13:21:46

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Google Analytics

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

 

#6 07-04-2007 19:18:08

jonaha
Member
Registered: 11-01-2006
Posts: 192

Re: Google Analytics

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>&copy; <?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>
&nbsp;
<img src="media/khxc/valid-xhtml10.png" alt="Valid XHTML" width="79" height="24" />
&nbsp;
<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

 

#7 07-05-2007 04:14:37

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Google Analytics

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

 

#8 07-05-2007 06:31:53

jonaha
Member
Registered: 11-01-2006
Posts: 192

Re: Google Analytics

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

 

#9 07-05-2007 07:03:21

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Google Analytics

When you try validating against your new site what is reported?

Offline

 

#10 07-05-2007 10:35:00

jonaha
Member
Registered: 11-01-2006
Posts: 192

Re: Google Analytics

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

 

#11 07-05-2007 10:39:47

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Google Analytics

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.


Nick Hendler

Offline

 

#12 07-05-2007 14:34:26

jonaha
Member
Registered: 11-01-2006
Posts: 192

Re: Google Analytics

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>&copy; <?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>
&nbsp;
<img src="media/khxc/valid-xhtml10.png" alt="Valid XHTML" width="79" height="24" />
&nbsp;
<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

 

#13 07-12-2007 09:54:08

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Google Analytics

You don't put that at the end - it needs to go in the <head> of the XHTML to work.  It's JavaScript.


Nick Hendler

Offline

 

#14 09-23-2007 19:39:58

boson
Member
Registered: 09-18-2007
Posts: 9

Re: Google Analytics

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

 

#15 05-16-2008 18:00:43

wyattea
Member
Registered: 01-07-2006
Posts: 1650

Re: Google Analytics

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

 

#16 02-26-2009 16:22:45

vytal
Member
From: Watford
Registered: 02-26-2009
Posts: 1
Website

Re: Google Analytics

Can I use the new tracking code (ga.js) or should I stick with legacy tracking code (urchin.js) ?

Helen...

Offline

 

Board footer