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

Google Analytics Integration

Views: 225,778

Results 521 to 540 of 660
8 Jan 2009, 6:44 PM
#521
benbirdx avatar

benbirdx

New Zenner

Join Date:
Jan 2009
Posts:
18
Plugin Contributions:
0

Google Analytics Integration

bhakans:

I have this module installed and visitors seem to be correctly monitored and reported in my Google Analytics account. However, the ecommerce reporting doesn't seem to work. I have made sales but my Ecommerce overview in GA still report 0 across the board..

Where do I begin troubleshooting this?

I am having the same problem.

9 Jan 2009, 3:42 AM
#522
wagnerguy avatar

wagnerguy

Zen Follower

Join Date:
Aug 2008
Posts:
334
Plugin Contributions:
0

Re: Google Analytics Integration

wagnerguy:

hello all, I am using 1.3.xx

I installed analytics and it it work for a while, I then it stopped. but my google account still does not give me an error. it says my account is being read..

I have since then moved to SSl, and I changed a template.

but when i ran a scan using epikone, it said analytics was not in any of my page..

how do i add/correct this issue

do i need to re-install this.. it tells me that it has ran but the file is not updated in my directory.. i have checked the permissions, but nothing is saved.

12 Jan 2009, 8:19 AM
#523
luna avatar

luna

New Zenner

Join Date:
Dec 2008
Location:
BC, Canada
Posts:
15
Plugin Contributions:
0

Re: Google Analytics Integration

Hi,

I have a dummy question, please!:blush:

  1. I uploaded the files in the add-on to the appropriate directories
  2. I installed the SQL patches in install.sql
  3. I configured in Admin->Configuration->Google Analytics to include my GA #
  4. I went into my GA account and changed E-Commerce to Yes.

Now I want to know if I should paste the tracking code from GA somewhere in my files? If yes, where?

Thank you for your help!

Luna

12 Jan 2009, 9:11 AM
#524
bhakans avatar

bhakans

New Zenner

Join Date:
Sep 2008
Posts:
22
Plugin Contributions:
0

Re: Google Analytics Integration

Luna:

Hi,

I have a dummy question, please!:blush:

  1. I uploaded the files in the add-on to the appropriate directories
  2. I installed the SQL patches in install.sql
  3. I configured in Admin->Configuration->Google Analytics to include my GA #
  4. I went into my GA account and changed E-Commerce to Yes.

Now I want to know if I should paste the tracking code from GA somewhere in my files? If yes, where?

Thank you for your help!

Luna

No, but according to the instructions you do need to add the following code to your tpl_footer.php or to tpl_main_page.php:

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

Those are found in /includes/templates/YOUR_TEMPLATE/common/

12 Jan 2009, 9:14 AM
#525
bhakans avatar

bhakans

New Zenner

Join Date:
Sep 2008
Posts:
22
Plugin Contributions:
0

Re: Google Analytics Integration

Does someone have any suggestions to my question above - why my GA do report visitors but does not react to any sales I make?

How can the one thing function without the other?

The only special thing that I can think of is that my shop uses "Magic SEO Urls". But that shouldn't affect e commerce tracking, should it?

12 Jan 2009, 3:26 PM
#526
bhakans avatar

bhakans

New Zenner

Join Date:
Sep 2008
Posts:
22
Plugin Contributions:
0

Re: Google Analytics Integration

bhakans:

Does someone have any suggestions to my question above - why my GA do report visitors but does not react to any sales I make?

How can the one thing function without the other?

The only special thing that I can think of is that my shop uses "Magic SEO Urls". But that shouldn't affect e commerce tracking, should it?

Update: I PM:ed Andrew and he answered that another update of the module might be needed to fix this.

12 Jan 2009, 3:45 PM
#527
luna avatar

luna

New Zenner

Join Date:
Dec 2008
Location:
BC, Canada
Posts:
15
Plugin Contributions:
0

Re: Google Analytics Integration

Thank you Bhakans,

Sorry I forgot to mention that I did add this code in my tpl_footer.php.

When I check my status on GA, everything is fine. Google says it's receiving data. I installed my GA 2 days ago, so it should be reporting.

On Zen Cart admin I can see that I have had many hits on the hits counter.

What do I miss?

Thanks again

Luna

13 Jan 2009, 9:18 AM
#528
bhakans avatar

bhakans

New Zenner

Join Date:
Sep 2008
Posts:
22
Plugin Contributions:
0

Re: Google Analytics Integration

Then I am afraid I don't know what is the problem. If your analytics account says it is receiving data I believe the tracking should work...

20 Jan 2009, 12:47 AM
#529
graniteman44 avatar

graniteman44

Zen Follower

Join Date:
Dec 2007
Location:
Michigan
Posts:
160
Plugin Contributions:
0

Re: Google Analytics Integration

I have installed the .sql file and the googleanalytics configuration shows up in the Admin. I uploaded the two files from the simple_google_analytics_1-2-2 file but I am not seeing the code at the bottom of my page when I view source. I have installed it and reinstalled it five times now and no luck. I originally had installed google_analytics_by_andrew_2-2-1 but didn't have luck with that one either.

I am using version 1.3.7 and my website is http://monumentsplus.com

Please help. It seems so simple but yet it isn't showing up.

20 Jan 2009, 4:12 PM
#530
benbirdx avatar

benbirdx

New Zenner

Join Date:
Jan 2009
Posts:
18
Plugin Contributions:
0

Re: Google Analytics Integration

I cannot get eCommerce tracking through GA to work on a new zen cart implementation, nor can I find a simple walkthrough showing where and what code I need to add.

Can anyone help?

Thank you in advance,
Ben

24 Jan 2009, 4:24 AM
#532
camargotobon avatar

camargotobon

New Zenner

Join Date:
Aug 2006
Posts:
6
Plugin Contributions:
0

Re: Google Analytics Integration

swamyg1:

Is this the same mod as this???

http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_47&products_id=412

hi
I have some issues installing INSTALL.SQL code . After that
it shows

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Google Analytics Configuration'' LIMIT 1' at line 1
in:

I don´t have what happened there?
could i have some help?
thanks in advance

15 Feb 2009, 4:25 PM
#533
daven613 avatar

daven613

New Zenner

Join Date:
Feb 2009
Posts:
3
Plugin Contributions:
0

Re: Google Analytics Integration

Hi,
I'm installing Google analytics for the first time. In the readme file it says:

2. Make sure your body tag in /includes/templates/[your_template]/common/tpl_main_page.php
includes this code (if not see trouble shooting below it is not neccassary but an addition
to your template needs to be made):

But I don't have a folder called /includes/templates/[your_template]/common/ and the only place that I find the file tpl_main_page.php in /includes/templates/template_default/common.

Ps. I understand that [your_template] must me replaced with my template folder name, which is in my case mostlygrey

Thanks in advance.:smile:

15 Feb 2009, 7:28 PM
#534
tonibarcelona avatar

tonibarcelona

Inactive

Join Date:
Feb 2007
Location:
Barcelona
Posts:
200
Plugin Contributions:
0

Re: Google Analytics Integration

bhakans:

Update: I PM:ed Andrew and he answered that another update of the module might be needed to fix this.

Me too (same problem since December, afetr months of working properly) Any news about the update of the module?

15 Feb 2009, 7:32 PM
#535
tonibarcelona avatar

tonibarcelona

Inactive

Join Date:
Feb 2007
Location:
Barcelona
Posts:
200
Plugin Contributions:
0

Re: Google Analytics Integration

daven613:

Hi,
I'm installing Google analytics for the first time. In the readme file it says:

2. Make sure your body tag in /includes/templates/[your_template]/common/tpl_main_page.php
includes this code (if not see trouble shooting below it is not neccassary but an addition
to your template needs to be made):

But I don't have a folder called /includes/templates/[your_template]/common/ and the only place that I find the file tpl_main_page.php in /includes/templates/template_default/common.
You must create a directory with this path and copy inside the file tpl_main_page.php from /includes/templates/template_default/common

6 Mar 2009, 1:41 PM
#536
tmdelia avatar

tmdelia

New Zenner

Join Date:
May 2005
Posts:
69
Plugin Contributions:
0

Re: Google Analytics Integration

I'm trying to add the code to this mode to treat certain keywords or URLs as direct referrals instead of keywords.

Here's the affected part of my code (just the part between ```

<script type=quot;text/javascript"> and </script>
)```
<script type="text/javascript">
<!--
if(!gaJsHost) {
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
}
//-->
</script>
<script type="text/javascript">
<!--
if(!pageTracker) {
var pageTracker = _gat._getTracker('<?php echo GOOGLE_ANALYTICS_UACCT; ?>');
pageTracker._addIgnoredOrganic("www.mydomainvariation.com");
pageTracker._addIgnoredOrganic("domainvariation");
pageTracker._addIgnoredOrganic("\"domain variation\"");
<?php if(GOOGLE_ANALYTICS_DOMAINNAME != '') { ?>
pageTracker._setDomainName('<?php echo GOOGLE_ANALYTICS_DOMAINNAME; ?>');
<?php } ?>
<?php if(GOOGLE_ANALYTICS_ALLOWLINKER == 'true') { ?>
pageTracker._setAllowLinker(true);
<?php } ?>
pageTracker._initData();
pageTracker._trackPageview(<?php echo $google_analytics_page; ?>);
}
<?php
// http://www.google.ru/support/googleanalytics/bin/answer.py?answer=55528
if($_GET['main_page'] == FILENAME_CHECKOUT_SUCCESS && (!isset($_SESSION['google_analytics']) || !in_array($zv_orders_id, $_SESSION['google_analytics']))) {
  if(!isset($_SESSION['google_analytics'])) $_SESSION['google_analytics'] = array();
  $_SESSION['google_analytics'][] = $zv_orders_id;
  $_trackTrans = '';
  require_once(DIR_WS_CLASSES . 'order.php');
  $order = new order($zv_orders_id);
//echo '<pre>';var_export($order);echo '</pre>';
  switch (GOOGLE_ANALYTICS_TARGET) {
    case 'delivery':
      $google_analytics = $order->delivery;
      break;
    case 'billing':
      $google_analytics = $order->billing;
      break;
    case 'customers':
    default:
      $google_analytics = $order->customer;
      break;
  }

  $google_analytics['ot_shipping'] = 0;
  $totals = $db->Execute("SELECT value
                          FROM " . TABLE_ORDERS_TOTAL . "
                          WHERE orders_id = '" . (int)$zv_orders_id . "'
                            AND class = 'ot_shipping'");
  if (!$totals->EOF) {
    $google_analytics['ot_shipping'] = $totals->fields['value'];
  }
/*
  foreach ($order->totals as $k => $v) {
    var_dump($v['class'], $v['text']);echo '<br />';
    if($v['class'] == '') {
      $google_analytics['ot_shipping'] = float($v['text']);
      break;
    }
  }
*/
//  pageTracker._addTrans(Order_ID, Affiliation, Total, Tax, Shipping, City, State, Country);
  $_trackTrans .= '  pageTracker._addTrans(' .
                  '"' . $zv_orders_id . '",' .
                  '"' . GOOGLE_ANALYTICS_AFFILIATION . '",' .
                  '"' . number_format($order->info['total'], 3, '.', '') . '",' .
                  '"' . number_format($order->info['tax'], 3, '.', '') . '",' .
                  '"' . number_format($google_analytics['ot_shipping'], 3, '.', '') . '",' .
                  '"' . zen_output_string_protected($google_analytics['city']) . '",' .
                  '"' . zen_output_string_protected($google_analytics['state']) . '",' .
                  '"' . zen_output_string_protected($google_analytics['country']) . '");' . "\n";

  for ($i=0; $i<sizeof($order->products); $i++) {
/*
    $category_query = "SELECT cd.categories_name
                       FROM " . TABLE_PRODUCTS . " p
                         LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON (cd.categories_id = p.master_categories_id)
                       WHERE p.products_id = :productsID
                         AND cd.language_id = :languagesID
                       LIMIT 1";
    $category_query = $db->bindVars($category_query, ':languagesID', $_SESSION['languages_id'], 'integer');
    $category_query = $db->bindVars($category_query, ':productsID', zen_get_prid($order->products[$i]['id']), 'integer');
    $category = $db->Execute($category_query);
    $categories_name = $category->fields['categories_name'];
*/
    $categories_name = zen_get_categories_name_from_product(zen_get_prid($order->products[$i]['id']));
    if(GOOGLE_ANALYTICS_SKUCODE == 'products_model') {
      $products_skucode = $order->products[$i]['model'];
    } else {
      $products_skucode = $order->products[$i]['id'];
    }
    $products_attributes_name = '';
    if (isset($order->products[$i]['attributes'])) {
      for ($j=0; $j<sizeof($order->products[$i]['attributes']); $j++) {
        $products_attributes_name .= $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . GOOGLE_ANALYTICS_PRODUCTS_ATTRIBUTES_DELIMITER;
      }
      $products_attributes_name = substr(GOOGLE_ANALYTICS_PRODUCTS_ATTRIBUTES_BRACKETS, 0, 1) . rtrim($products_attributes_name, GOOGLE_ANALYTICS_PRODUCTS_ATTRIBUTES_DELIMITER) . substr(GOOGLE_ANALYTICS_PRODUCTS_ATTRIBUTES_BRACKETS, 1, 1);
    }
//   pageTracker._addItem(Order_ID, SKU, Product_Name, Category, Price, Quantity);
    $_trackTrans .= '  pageTracker._addItem(' .
                    '"' . $zv_orders_id . '",' .
                    '"' . zen_output_string_protected($products_skucode) . '",' .
                    '"' . zen_output_string_protected($order->products[$i]['name'] . $products_attributes_name) . '",' .
                    '"' . zen_output_string_protected($categories_name) . '",' .
                    '"' . number_format($order->products[$i]['final_price'], 2, '.', '') . '",' .
                    '"' . $order->products[$i]['qty'] . '");' . "\n";
  }
  $_trackTrans .= 'pageTracker._trackTrans();' . "\n";
  echo $_trackTrans;
}
?>
//-->
</script>

However, the keywords related to my domain that I'm trying to supress are still showing add adding traffic to the Keywords part of Analytics, rather than moving that traffic into Direct.

Any ideas what is wrong with the code?

I notice on the support site on Google for achieving this, http://www.google.com/support/googleanalytics/bin/answer.py?answer=55479, there is one discrepancy between their code and this code:

Google says:

pageTracker._trackPageview();

This code says:

pageTracker._trackPageview(<?php echo $google_analytics_page; ?>);

Any help is greatly appreciated.

Thanks for the great mod.

7 Mar 2009, 10:53 AM
#537
accurax avatar

accurax

New Zenner

Join Date:
Mar 2008
Posts:
67
Plugin Contributions:
0

Re: Google Analytics Integration

my god you instructions bite ! ..... the mod itself looks promising... but youve ruined it with shoddy instructions mate.

is anyone able to shed some light on this rubbish ?

  1. EDIT:
    tpl_footer.php or tpl_main_page.php or any other that you want.
    (for example: copy template_default/common/tpl_footer.php then edit and save in YOUR_TEMPLATE/common/ directory).
    To any place that you want add
<?php include($template->get_template_dir('tpl_footer_googleanalytics.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer_googleanalytics.php'); ?>

For ex. to the bottom of the tpl_footer.php.

i mean honestly .... what the #!#@ does that mean ?!

8 Mar 2009, 2:01 PM
#538
a_berezin avatar

a_berezin

Deceased

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

Re: Google Analytics Integration

accurax,
Don't use this module, if you can't comply with such primitive instructions. You certainly will be more problems.

8 Mar 2009, 3:02 PM
#539
handicrafthut avatar

handicrafthut

New Zenner

Join Date:
Aug 2008
Location:
India
Posts:
3
Plugin Contributions:
0

Re: Google Analytics Integration

Hi,

I have integrated Google Analytic in my zen-cart. After setting up my account there on Google site it is showing in check status section as receiving data like this...

However it is showing error on overview & website profile page like this.....

I try and find the same with latest code given by Google Analytics is this...

Which doesn't match with the code at the page source as a result by implementing Google Analytics in Zen-Cart, which is this...

What i am able to rectify the problem is the code executed by zencart module is inside the comment tags, thats why not able to run.

Can Anybody solve this problem for me..

Hope to hear from anyone with a solution for this.

Regards,

Aakash Tomar

8 Mar 2009, 3:04 PM
#540
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
730
Plugin Contributions:
0

Re: Google Analytics Integration

I second that Andrew. This forum doesn't need morons like Accurax. If you can't understand instructions like that, theres no need to throw bad language into the mix. The guys who create these modules - like Andrew - aren't charging for them, and they ain't gonna help people like you with an attitude like that.