Zen Cart Logo
Forums / All Other Contributions/Addons / Google Analytics Integration

Google Analytics Integration

Views: 225,786

Results 161 to 180 of 660
12 Dec 2006, 5:07 PM
#161
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Google Analytics Integration

All works great!
But my order total is euro324,30, instead in analytics I see euro324,00; tax is 54,05, I see 54,00....
Why?

12 Dec 2006, 7:07 PM
#162
samad64 avatar

samad64

Totally Zenned

Join Date:
May 2006
Location:
Texas
Posts:
554
Plugin Contributions:
2

Re: Google Analytics Integration

100asa:

All works great!
But my order total is euro324,30, instead in analytics I see euro324,00; tax is 54,05, I see 54,00....
Why?

How did you get it to show in analytics? Is it constantly showing.. or just every few transactions? Mine recorded 2 transactions and didn't record anything afterwards

13 Dec 2006, 8:06 AM
#163
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Re: Google Analytics Integration

The record by Google analytics is more slow, but it record all (at this time)
I've installed only variant_include mod by Andrew, and all works!
The little bug is only the amount of transaction, as I say in the last post.

13 Dec 2006, 8:19 AM
#164
samad64 avatar

samad64

Totally Zenned

Join Date:
May 2006
Location:
Texas
Posts:
554
Plugin Contributions:
2

Re: Google Analytics Integration

on line 45.. try changing

number_format($products->fields['final_price'], 2, ',', '')

to

number_format($products->fields['final_price'], 2, '.', ',')

I haven't tested this.. however I'm in the process of doing so (just installed latest version w/ this change).. so ill report back once i get some sales :)

13 Dec 2006, 11:14 AM
#165
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Re: Google Analytics Integration

I'm an Italian seller. Our prices is in Euro; ex 1.320,45
I can't see the decimal amount.
I'm trying this change, and I wait next sales :-)

13 Dec 2006, 12:08 PM
#166
a_berezin avatar

a_berezin

Deceased

Join Date:
Aug 2004
Location:
Saint Petersburg, Russia
Posts:
1,782
Plugin Contributions:
5

Re: Google Analytics Integration

getyourgameshere.com:

on line 45.. try changing

number_format($products->fields['final_price'], 2, ',', '')

> 
> to
> 
> ```
number_format($products->fields['final_price'], 2, '.', ',')
```Yes, yes, yes!!!
13 Dec 2006, 1:53 PM
#167
archer904 avatar

archer904

New Zenner

Join Date:
Dec 2006
Posts:
7
Plugin Contributions:
0

Re: Google Analytics Integration

Hi guys,

This thread is now famous. I found it through Google.

I'm new to this discussion, and I know that mods have been presented, bugs have been reported, bugs have been fixed, things have been updated, etc.

What I'm here to ask, for all the newbs who have just surfed in and see an 18 page thread:

What is the current disposition? Just to drop the Analytics script into a particular file, and tell google the URL for our checkout page? Or should we use a particular, updated module, or what? Thanks.

13 Dec 2006, 2:00 PM
#168
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Re: Google Analytics Integration

Download the latest mod by Andrew http://zen-cart.spb.ru/index.php?main_page=contributions
and then use only variant_include.
So my google analytics works very well!

13 Dec 2006, 2:18 PM
#169
archer904 avatar

archer904

New Zenner

Join Date:
Dec 2006
Posts:
7
Plugin Contributions:
0

Re: Google Analytics Integration

100asa:

Download the latest mod by Andrew http://zen-cart.spb.ru/index.php?main_page=contributions
and then use only variant_include.
So my google analytics works very well!

In the zip file I have located the variant_include folder. Inside it is the Includes folder. In that is the Templates folder. Inside that is the YOUR_TEMPLATE folder. Inside that is the Common folder, and in that is the file tpl_footer_googleanalytics.php.

So do I put the variant_include folder and everything inside it in a particular directory? Or just tpl_footer_googleanalytics.php? Or do I need to do something else?

14 Dec 2006, 3:33 PM
#170
cuda avatar

cuda

Zen Follower

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

Re: Google Analytics Integration

Ok I have been saying I was going to release a simplified version of this moduke for some time now and I finally got around to doing it. My version does not include any extra JavaScript works for secure and nonsecure pages and allows for full ecommerce tracking. The tracking code and the checkout success code is included at the bottom of your template and visable.

There are only 2 files to upload one of which is only one line and an sql patch. It is based on a_berezin's code here but reduced and reworked.

The support thread is at:
http://www.zen-cart.com/forum/showthread.php?t=53701

Download is currently available at:
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=412

Hope this helps some of you out.

16 Dec 2006, 12:17 AM
#171
archer904 avatar

archer904

New Zenner

Join Date:
Dec 2006
Posts:
7
Plugin Contributions:
0

Re: Google Analytics Integration

Okay,

I'm following the instructions in the README file, which say:

  1. At the bottom of templates/[your_template]/common/tpl_main_page.php
    Add this just before the </body> tag:
<?php require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php'); ?>However, my tpl_main_page.php file does not contain a </body> tag. This is the full text of my tpl_main_page.php file:

<?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()

So where do I stick the required code? :lamo:

Thanks for your help.

16 Dec 2006, 12:43 AM
#172
samad64 avatar

samad64

Totally Zenned

Join Date:
May 2006
Location:
Texas
Posts:
554
Plugin Contributions:
2

Re: Google Analytics Integration

i put mine at the bottom of tpl_footer.php .. it just needs to be at the lower end of the page somewhere

16 Dec 2006, 8:50 AM
#173
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Re: Google Analytics Integration

I've put this:

<?php include($template->get_template_dir('tpl_footer_googleanalytics.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer_googleanalytics.php'); ?>

on includes/templates/my_template/common/tpl_footer.php
after the last ?>
I'm clear?

16 Dec 2006, 8:52 AM
#174
samad64 avatar

samad64

Totally Zenned

Join Date:
May 2006
Location:
Texas
Posts:
554
Plugin Contributions:
2

Re: Google Analytics Integration

100asa:

I've put this:

<?php include($template->get_template_dir('tpl_footer_googleanalytics.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer_googleanalytics.php'); ?>

on includes/templates/my_template/common/tpl_footer.php
after the last ?>
I'm clear?

I think thats where I put mine as well.. should be alright

16 Dec 2006, 10:37 AM
#175
a_berezin avatar

a_berezin

Deceased

Join Date:
Aug 2004
Location:
Saint Petersburg, Russia
Posts:
1,782
Plugin Contributions:
5

Re: Google Analytics Integration

Hi getyourgameshere.com,

getyourgameshere.com:

on line 45.. try changing

number_format($products->fields['final_price'], 2, ',', '')

> 
> to
> 
> ```
number_format($products->fields['final_price'], 2, '.', ',')

to

number_format($products->fields['final_price'], 3, '.', '')
16 Dec 2006, 10:51 AM
#176
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: Google Analytics Integration

Just downloaded/installed Andrew's latest version v.1.21 on Zen Cart 1.36. Installed "variant_javascript" version. EASY install!

And after configuring everything (in Zen Cart admin > Configuration and also in Google Analytics account settings) I viewed the source of the shop home page and observed near the bottom:

<div style="position: absolute; top: -1000px; left: -1000px;"><span class="ygtvtn"> </span><span class="ygtvtm"> </span><span class="ygtvtmh"> </span><span class="ygtvtp"> </span><span class="ygtvtph"> </span><span class="ygtvln"> </span><span class="ygtvlm"> </span><span class="ygtvlmh"> </span><span class="ygtvlp"> </span><span class="ygtvlph"> </span><span class="ygtvloading"> </span></div>

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
  _uacct = 'UA-XXXXXXX-1';
  urchinTracker();
</script>
</body>
  1. Does anyone have a clue what the source would be of all the strange span classes and non-breaking spaces would be from? Is this from the Google Analytics Integration mod?

  2. BTW it is easy to forget...

In Admin > Configuration > Google Analytics Integration > Analytics Account

Be sure to append a "-1" to the end of your account number (or whatever the number of the profile you set up in your GA account settings).

  1. Thanks for the update Andrew! New version is working well.

Woody

16 Dec 2006, 6:31 PM
#177
samad64 avatar

samad64

Totally Zenned

Join Date:
May 2006
Location:
Texas
Posts:
554
Plugin Contributions:
2

Re: Google Analytics Integration

a_berezin:

Hi getyourgameshere.com,

to

number_format($products->fields['final_price'], 3, '.', '')


Ah.. I knew I had messed up somewhere. Thanks Andrew!
16 Dec 2006, 6:39 PM
#178
a_berezin avatar

a_berezin

Deceased

Join Date:
Aug 2004
Location:
Saint Petersburg, Russia
Posts:
1,782
Plugin Contributions:
5

Re: Google Analytics Integration

And replace it on 2 lines!

16 Dec 2006, 6:44 PM
#179
samad64 avatar

samad64

Totally Zenned

Join Date:
May 2006
Location:
Texas
Posts:
554
Plugin Contributions:
2

Re: Google Analytics Integration

a_berezin:

And replace it on 2 lines!

For anyone else interested.. its lines 31 and 45

19 Dec 2006, 8:42 AM
#180
stenrique avatar

stenrique

Zen Follower

Join Date:
Apr 2005
Posts:
355
Plugin Contributions:
0

Re: Google Analytics Integration

I've downloaded the mod., read the forum and readme file. I'm still rather confused as to its installation. > Woodymon:

Just downloaded/installed Andrew's latest version v.1.21 on Zen Cart 1.36. Installed "variant_javascript" version. EASY install!
The quote above seems to indicate that only the files in variant_javascript folders are required. But the readme file states:
1.1. ONLY FOR variant_include. Edit tpl_footer.php or tpl_main_page.php or any other that you want...

So do I copy ALL the files in the following folders:
includes/...
variant_include/...
variant_javascript/...

(changing "YOUR_TEMPLATE" to my own template directory accordingly) or do I just copy the files in the includes/... folder?

TIA