Forums / All Other Contributions/Addons / Simple Google Analytics - Support

Simple Google Analytics - Support

Views: 453,419

Results 41 to 60 of 2,165
31 Jan 2007, 9:26 PM
#41
cuda avatar

cuda

Zen Follower

Join Date:
Jul 2006
Posts:
119
Plugin Contributions:
0

Simple Google Analytics - Support

bettysue:

Dr. Byte,

Any idea why I'm getting the double // in my error message above? I checked the google analytics file and it just has one / in it.

thank you,
betty

betty the double forward slashes may be a server setting or it may be a change to the get_template_dir() function in 1.3.7 either way it should not matter. To make it look nicer remove the '/' before 'google_analytics.php' from this line in your template:

require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php');

To make it look like this

require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . 'google_analytics.php');

And if you used dr bytes suggestion to check if the file exists change that line too.

I still do not see your google account number showing up in the tracking code on your home page so there is another issue.....But not sure how the XXXX could posible show up unless you have it entered in your dB or hard coded somewhere. You sure your account number is in your admin....I just don't see any other way for this code to spit our xxxxx unless that is the number in your dB and make sure it is on your live site and not a local test site.

Sorry for the delay in response had some car troubles and been shopping around the last couple days for a new one.

cuda


Barracuda Productions pure instincts

31 Jan 2007, 9:41 PM
#42
threekni avatar

threekni

New Zenner

Join Date:
Jan 2007
Posts:
9
Plugin Contributions:
0

Re: Simple Google Analytics - Support

I have everything installed and setup on our site www.threeknightsgaming.com but when I hit google it says it can't find the files needed. I have this on

my /public_html/includes/templates/template_default/common/tpl_main_page.php

<?php /** * Common Template - tpl_main_page.php * * Governs the overall layout of an entire page<br /> * Normally consisting of a header, left side column. center column. right side column and footer<br /> * For customizing, this file can be copied to /templates/your_template_dir/pagename<br /> * example: to override the privacy page<br /> * - make a directory /templates/my_template/privacy<br /> * - copy /templates/templates_defaults/common/tpl_main_page.php to /templates/my_template/privacy/tpl_main_page.php<br /> * <br /> * to override the global settings and turn off columns un-comment the lines below for the correct column to turn off<br /> * to turn off the header and/or footer uncomment the lines below<br /> * Note: header can be disabled in the tpl_header.php<br /> * Note: footer can be disabled in the tpl_footer.php<br /> * <br /> * $flag_disable_header = true;<br /> * $flag_disable_left = true;<br /> * $flag_disable_right = true;<br /> * $flag_disable_footer = true;<br /> * <br /> * // example to not display right column on main page when Always Show Categories is OFF<br /> * <br /> * if ($current_page_base == 'index' and $cPath == '') {<br /> * $flag_disable_right = true;<br /> * }<br /> * <br /> * example to not display right column on main page when Always Show Categories is ON and set to categories_id 3<br /> * <br /> * if ($current_page_base == 'index' and $cPath == '' or $cPath == '3') {<br /> * $flag_disable_right = true;<br /> * }<br /> * * @package templateSystem * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_main_page.php 3856 2006-06-29 02:26:33Z drbyte $ */ // the following IF statement can be duplicated/modified as needed to set additional flags if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) { $flag_disable_right = true; } $header_template = 'tpl_header.php'; $footer_template = 'tpl_footer.php'; $left_column_file = 'column_left.php'; $right_column_file = 'column_right.php'; $body_id = str_replace('_', '', $_GET['main_page']); ?> <body id="<?php echo $body_id . 'Body'; ?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'; ?>> <?php if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerOne" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?> <div id="mainWrapper"> <?php /** * prepares and displays header output * */ require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');?> <table width="100%" border="0" cellspacing="0" cellpadding="0" id="contentMainWrapper"> <tr> <?php if (COLUMN_LEFT_STATUS == 0 or (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '')) { // global disable of column_left $flag_disable_left = true; } if (!isset($flag_disable_left) || !$flag_disable_left) { ?> <td id="navColumnOne" class="columnLeft" style="width: <?php echo COLUMN_WIDTH_LEFT; ?>"> <?php /** * prepares and displays left column sideboxes * */ ?> <div id="navColumnOneWrapper" style="width: <?php echo BOX_WIDTH_LEFT; ?>"><?php require(DIR_WS_MODULES . zen_get_module_directory('column_left.php')); ?></div></td> <?php } ?> <td valign="top"> <!-- bof breadcrumb --> <?php if (DEFINE_BREADCRUMB_STATUS == '1') { ?> <div id="navBreadCrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div> <?php } ?> <!-- eof breadcrumb --> <?php if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?> <!-- bof upload alerts --> <?php if ($messageStack->size('upload') > 0) echo $messageStack->output('upload'); ?> <!-- eof upload alerts --> <?php /** * prepares and displays center column * */ require($body_code); ?> <?php if (SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerFour" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?></td> <?php if (COLUMN_RIGHT_STATUS == 0 or (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '')) { // global disable of column_right $flag_disable_right = true; } if (!isset($flag_disable_right) || !$flag_disable_right) { ?> <td id="navColumnTwo" class="columnRight" style="width: <?php echo COLUMN_WIDTH_RIGHT; ?>"> <?php /** * prepares and displays right column sideboxes * */ ?> <div id="navColumnTwoWrapper" style="width: <?php echo BOX_WIDTH_RIGHT; ?>"><?php require(DIR_WS_MODULES . zen_get_module_directory('column_right.php')); ?></div></td> <?php } ?> </tr> </table> <?php /** * prepares and displays footer output * */ require($template->get_template_dir('tpl_footer.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer.php');?> </div> <!--bof- parse time display --> <?php if (DISPLAY_PAGE_PARSE_TIME == 'true') { ?> <div class="smallText center">Parse Time: <?php echo $parse_time; ?> - Number of Queries: <?php echo $db->queryCount(); ?> - Query Time: <?php echo $db->queryTime(); ?></div> <?php } ?> <!--eof- parse time display --> <!--bof- banner #6 display --> <?php if (SHOW_BANNERS_GROUP_SET6 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET6)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerSix" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?> <!--eof- banner #6 display --> <?php require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php'); ?> </body>
31 Jan 2007, 9:43 PM
#43
bettysue avatar

bettysue

Inactive

Join Date:
May 2004
Posts:
747
Plugin Contributions:
0

Re: Simple Google Analytics - Support

peggyc:

I actually got the identical error bettysue described in doing test runs through my site. I plugged your fix in on tpl_main_page.php and what it does now is just not call for the google analytics code on checkout_success (although the script appears to show up just fine on every other page in the site, including the other pages in the checkout process.)

Obviously it's preferable to have no error code show up, so I thank you for the fix! But I am curious as to what it is about checkout_success that causes the error in the first place, when it didn't occur on any other page in the site.

I had another error issue that I had posted in a different thread which is about the JRox affiliate manager.

The reply there indicated that Jrox may not work with express pay. Although after I installed Dr. Bytes paypal update I didn't get those error messages any more.

betty

31 Jan 2007, 9:47 PM
#44
cuda avatar

cuda

Zen Follower

Join Date:
Jul 2006
Posts:
119
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Nellie:

I have this installed on ver 1.2.7, it records the visits and goal conversions, but not the transaction and order value. Any ideas where I am going wrong?

Hey nellie I am back to help....

ok first things first view the source of your home page:

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-861757-5";
urchinTracker();
</script><script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-861757-5";
urchinTracker();
</script>

Notice the double up of tracking code. This is probably due to you adding a hard coded version as google suggests and using the one line include from this module. Remove the hard coded line from your template all you need is this line (modified with dr bytes suggestion to check the file is actually there):

<?php
if (file_exists($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php'))
	{
	require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php');
	}
?>

This maybe the issue as to why you are not getting checkout tracking it may also have to do with paygate. What is the test credit card number for paygate so I can make a fake purchase and check the code?

cuda


Barracuda Productions pure instincts

31 Jan 2007, 9:47 PM
#45
peggyc avatar

peggyc

New Zenner

Join Date:
Jan 2007
Posts:
22
Plugin Contributions:
0

Re: Simple Google Analytics - Support

bettysue:

I had another error issue that I had posted in a different thread which is about the JRox affiliate manager.

The reply there indicated that Jrox may not work with express pay. Although after I installed Dr. Bytes paypal update I didn't get those error messages any more.

betty

Hmm, I'm using JRox too -- I wonder if there's some incompatibilty there causing this Analytics problem?

31 Jan 2007, 9:54 PM
#46
cuda avatar

cuda

Zen Follower

Join Date:
Jul 2006
Posts:
119
Plugin Contributions:
0

Re: Simple Google Analytics - Support

threekni:

I have everything installed and setup on our site www.threeknightsgaming.com but when I hit google it says it can't find the files needed. I have this on

my /public_html/includes/templates/template_default/common/tpl_main_page.php

Your code looks fine did you just instal it? In your google analytics account on the first page does your status column have a little green check next to recieving data? Where do you see this files are missing message?


Barracuda Productions pure instincts

31 Jan 2007, 10:08 PM
#47
bettysue avatar

bettysue

Inactive

Join Date:
May 2004
Posts:
747
Plugin Contributions:
0

Re: Simple Google Analytics - Support

cuda:

betty the double forward slashes may be a server setting or it may be a change to the get_template_dir() function in 1.3.7 either way it should not matter. To make it look nicer remove the '/' before 'google_analytics.php' from this line in your template:

require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php');

> 
> To make it look like this
> 
> ```php
require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . 'google_analytics.php');

And if you used dr bytes suggestion to check if the file exists change that line too.

I still do not see your google account number showing up in the tracking code on your home page so there is another issue.....But not sure how the XXXX could posible show up unless you have it entered in your dB or hard coded somewhere. You sure your account number is in your admin....I just don't see any other way for this code to spit our xxxxx unless that is the number in your dB and make sure it is on your live site and not a local test site.

Sorry for the delay in response had some car troubles and been shopping around the last couple days for a new one.

cuda

Ok, I've removed the / in the path and will see if that fixes it or if it errors out again.

As far as my analytics id, I feel like I'm in the twilight zone :blink: I checked in admin and it was back to the default listing with the X's in it again. This will make the third time I've entered my UH number in admin.

If it comes up missing again, then I definitely have more of a problem then a / !

thank you for the fix info and the fact my number was missing again.

betty

31 Jan 2007, 10:24 PM
#48
cuda avatar

cuda

Zen Follower

Join Date:
Jul 2006
Posts:
119
Plugin Contributions:
0

Re: Simple Google Analytics - Support

bettysue:

Ok,

If it comes up missing again, then I definitely have more of a problem then a / !

thank you for the fix info and the fact my number was missing again.

betty

Ok you have no code showing on your home page now. Put that slash back and upload the file. Then let me know so I can check it.

cuda


Barracuda Productions pure instincts

1 Feb 2007, 2:12 PM
#49
threekni avatar

threekni

New Zenner

Join Date:
Jan 2007
Posts:
9
Plugin Contributions:
0

Re: Simple Google Analytics - Support

cuda:

Your code looks fine did you just instal it? In your google analytics account on the first page does your status column have a little green check next to recieving data? Where do you see this files are missing message?

No it says status unverified when I have it try it says it can not locate the info on the pages.

1 Feb 2007, 10:16 PM
#50
bettysue avatar

bettysue

Inactive

Join Date:
May 2004
Posts:
747
Plugin Contributions:
0

Re: Simple Google Analytics - Support

cuda:

Ok you have no code showing on your home page now. Put that slash back and upload the file. Then let me know so I can check it.

cuda

Sorry for the delay Cuda, the email notification got lost amongst some other mail.

I put the / back in the code.

http://www.buysoul.com

thank you,

betty

1 Feb 2007, 10:33 PM
#51
cuda avatar

cuda

Zen Follower

Join Date:
Jul 2006
Posts:
119
Plugin Contributions:
0

Re: Simple Google Analytics - Support

bettysue:

Sorry for the delay Cuda, the email notification got lost amongst some other mail.

I put the / back in the code.

http://www.buysoul.com

thank you,

betty

Looks like you got it Bettysue, as far as I can see all the code is there that you need to track your site. Enjoy the stat's they can be very helpful!

cuda


Barracuda Productions pure instincts

1 Feb 2007, 11:12 PM
#52
bettysue avatar

bettysue

Inactive

Join Date:
May 2004
Posts:
747
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Thank you Cuda and Dr. Byte for the help and advise!!

betty

6 Feb 2007, 12:00 AM
#53
sajafari avatar

sajafari

New Zenner

Join Date:
Feb 2007
Posts:
2
Plugin Contributions:
0

Re: Simple Google Analytics - Support

i just installed it, it works great!

6 Feb 2007, 8:07 PM
#54
nellie avatar

nellie

New Zenner

Join Date:
Sep 2005
Posts:
49
Plugin Contributions:
0

Re: Simple Google Analytics - Support

cuda:

Hey nellie I am back to help....

ok first things first view the source of your home page:

Thanks Cuda, been away for a few days. I have removed the hard coded script in the footer, it now looks right when you view the source. Iwill have to contact Paygate re the dummy creditcard No, I dont have it off hand.

6 Feb 2007, 9:37 PM
#55
cuda avatar

cuda

Zen Follower

Join Date:
Jul 2006
Posts:
119
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Nellie:

Thanks Cuda, been away for a few days. I have removed the hard coded script in the footer, it now looks right when you view the source. Iwill have to contact Paygate re the dummy creditcard No, I dont have it off hand.

sounds good nellie just pm me the code so it is not out for everyone to see here on the forums.


Barracuda Productions pure instincts

8 Feb 2007, 2:14 PM
#56
cuda avatar

cuda

Zen Follower

Join Date:
Jul 2006
Posts:
119
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Nellie:

Thanks Cuda, been away for a few days. I have removed the hard coded script in the footer, it now looks right when you view the source. Iwill have to contact Paygate re the dummy creditcard No, I dont have it off hand.

Ok I got to the checkout success page using the HSBC payment method, the cc number you gave just always kicked me back to your payment page after I entered it. At the bottom of your checkout success page your code is only the standard tracking code:

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-xxxxxx-x";
urchinTracker();
</script>

Also on this page you do not have properly formated html because you do not have any </html> or </body> clossing tags. But that is besides the point...

It appears your your_template/google_analytics/google_analytics.php is not functioning properly. What you should see on your checkout_success page is something like this:

<script src="https://ssl.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-XXXXXX-1";
urchinTracker();
</script><form style="display:none;" name="utmform">
<textarea id="utmtrans">UTM:T|6||62.78|0.00|35.28|TEST|Louisiana|United States UTM:I|6|1191|product name|2.00|1</textarea>
</form>

Notice the hidden form with the transaction data. Try to upload the your_template/google_analytics/google_analytics.php file again. Also make sure you removed the hard coded google code and only have this at the bottom of your template just before the </body> tag:

<?php
if (file_exists($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php'))
	{
	require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php');
	}
?>

Then do a test transaction and view your source to see if you get the hidden transaction form....report back


Barracuda Productions pure instincts

9 Feb 2007, 8:05 PM
#57
nellie avatar

nellie

New Zenner

Join Date:
Sep 2005
Posts:
49
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Cuda, don't know if I got an old set of files, but my your_template/google_analytics/google_analytics.php does not have a closing body tag. These are the last few lines of code:

//echo transaction data
echo '<form style="display:none;" name="utmform">
<textarea id="utmtrans">' 
. addslashes($transaction) . ' ' 
. addslashes(trim($items))
. '</textarea>
</form>';
}
?>

Is this a problem?

9 Feb 2007, 8:26 PM
#58
nellie avatar

nellie

New Zenner

Join Date:
Sep 2005
Posts:
49
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Uploaded a new copy of your_template/google_analytics/google_analytics.php, but still not getting the hidden form.

9 Feb 2007, 8:37 PM
#59
cuda avatar

cuda

Zen Follower

Join Date:
Jul 2006
Posts:
119
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Nellie:

Cuda, don't know if I got an old set of files, but my your_template/google_analytics/google_analytics.php does not have a closing body tag. These are the last few lines of code:

//echo transaction data
echo '<form style="display:none;" name="utmform">

<textarea id="utmtrans">' . addslashes($transaction) . ' ' . addslashes(trim($items)) . '</textarea> </form>'; } ?> ``` > > Is this a problem?

Nellie there should be no closing tag in any of this modules files that should be in your main site template. Make sure the code at the bottom of your templates/[your_template]/common/tpl_main_page.php just before the body tag is:

<?php
if (file_exists($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php'))
	{
	require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php');
	}
?>

Is it there?


Barracuda Productions pure instincts

9 Feb 2007, 8:50 PM
#60
nellie avatar

nellie

New Zenner

Join Date:
Sep 2005
Posts:
49
Plugin Contributions:
0

Re: Simple Google Analytics - Support

This is what I have at the end of templates/[your_template]/common/tpl_main_page.php :

    <td align="center" colspan="3"><div class="banners"><?php echo zen_display_banner('static', $banner); ?></div>  </td>
  </tr>
<?php
    }
  }
?>
</table>
<?php require(DIR_WS_MODULES . 'footer.php'); ?>
<?php
require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php');
?>
</body>