Zen Cart Logo
Forums / All Other Contributions/Addons / Simple Google Analytics - Support

Simple Google Analytics - Support

Views: 451,119

Results 1,841 to 1,860 of 2,165
16 May 2012, 2:37 PM
#1841
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Simple Google Analytics - Support

notageek:

Hi, Countrycharm, thanks very much for your help.

So far, I have checked the installed code that used to work, and I am wondering why the code you mention is not the same; and also, why you have not mentioned the code that is in the html_header.php file.

In my tpl_main_page.php file I have this code--is it really wrong if it used to work?

<?php if (GOOGLE_ANALYTICS_TRACKING_TYPE == "Asynchronous") { // Do nothing } else { require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php'); } ?></body>
> 
> In my html_header.php file I have the following code:
> 
> ```
<?php
if (GOOGLE_ANALYTICS_TRACKING_TYPE == "Asynchronous") {
require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php');
}
?></head>
<?php // NOTE: Blank line following is intended: ?>

Secondly, following your suggestion, I tried to see if my site was receiving tracking, and although so far I cannot see where to edit my site data, I saw that it says "Tracking not installed."

I'm still trying to see where to find out how to install the tracking in Google Analytics, because in my site it does have the tracking code entered in Admin, and it used to track. I now recall that I did change the Google Analytics view to the new version, and am wondering if that has any relationship to losing ability to track my site.

I will just keep looking around the Google Analytics site to see if I can get somewhere. At the moment it takes me everywhere but where the answers are, it seems. I will let you know if I get somewhere with this problem, but in the meantime just have the curiosity about why my tracking code is different from the one you suggest, and why you do not mention the html_header.php tracking code.

Notageek

OK I figured out how to use the reply now....lol This is for you.

countrycharm:

Let me say this to you. Since version 1.2.5 the html_header.php is no longer needed. The code for Simple Google Analytics in that file can be deleted. Here is the upgrade instruction to get it to work for your site. Yes the change in code is needed.




Author: Eric Leuenberger (Zen ID: econcepts) http://www.ecommerceamplifier.com
Contribution Name: Simple Google Analytics
Version Date: v 1.2.5c 04/13/2012
Updated By: CountryCharm
License: under the GPL - See attached License for info.


Designed for: Zen Cart v1.5.0.



UPGRADING FROM PREVIOUS VERSIONS OF SIMPLE GOOGLE ANALYTICS:

!!!BACKUP!!! ALWAYS MAKE SURE YOU HAVE AN UP TO DATE BACKUP OF YOUR FILES and MySQL DATABASE BEFORE INSTALLING
You should test this on TEST SITE before going live!!!!!!!

Upgrading Simple Google Analytics from 1.3x compatible version to v1.5.0 ready version.

  1. Unzip the contribution.

  2. Open the zen_1.5.0 and then the upgrade folder.

  3. Change the admin folder name to match the name of your custom directory and ftp to your sever.

  4. Run the included 1-5-0_upgrade.sql using the Zen-Cart Sql Patches tool (admin -> tools -> install sql patches)
    For best results, copy-and-paste the code into the query field and press 'Send'.
    Delete the files in admin/includes/boxes/extra_boxes/ (these files are now obsolete and should be deleted in their entirety!!)

  5. NOTE: If you were using a previous version (1.2.x) of Google Analytics (prior to 1.2.3) then you'll need to change the code in the previous locations

At the bottom of /includes/templates/[your_template]/common/tpl_main_page.php

Find the lines of code that look like this (found below) just before the </body> tag:

<?php if (GOOGLE_ANALYTICS_TRACKING_TYPE == "Asynchronous") { require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php'); } ?>
> 
> 
> CHANGE / replace the lines of code to look like this:
> 
> 
> ```php
<?php
if (GOOGLE_ANALYTICS_TRACKING_TYPE == "Asynchronous") {
// Do nothing
} else {
require(DIR_WS_TEMPLATE . 'google_analytics/google_analytics.php');
}
?>

6.) In Version 1.2.5 a new override file is being used so there are a few lines of code you need to remove from a file (altered in previous versions) on your site.
This override file prevents the need for altering the 'html_header.php" file (as in some earlier versions.)

After uploading all files to the server do the following:

6a) Open the file found at: /includes/templates/[your_template]/common/html_header.php

6b) Find the lines that look like this just before the </head> tag and REMOVE them (delete). Save the file and re-upload to your server.

<?php /* Begin Simple Google Analytics */ if (in_array($current_page_base,explode(",",'popup_image,popup_image_additional,popup_cvv_help,popup_coupon_help,popup_attributes_qty_prices,popup_search_help,popup_shipping_estimator')) ) { //Skip outputting the tracking code as this is a pop-up window } else { // Print tracking code to page if (GOOGLE_ANALYTICS_TRACKING_TYPE == "Asynchronous") { require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php'); } } // end if for page determination /* End Simple Google Analytics */ ?>
> 
> 
> --------------------------------------------------------------------------
16 May 2012, 2:46 PM
#1842
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Simple Google Analytics - Support

Enviousgems:

Ok, didn't want to go through all these pages, but maybe someone can point out if there is something wrong with my google analytics ??
www.shopenviousgems.com

TIA

countrycharm:

What version of the Simple Google Analytics tracking are you using?

I would download the latest Google Analytics and install it.

16 May 2012, 6:36 PM
#1843
enviousgems avatar

enviousgems

New Zenner

Join Date:
Nov 2010
Posts:
37
Plugin Contributions:
0

Re: Simple Google Analytics - Support

countrycharm:

I would download the latest Google Analytics and install it.

Thanks, it's on my list for the person that will be doing my 1.5 Upgrade :D

17 May 2012, 11:28 PM
#1844
yaro avatar

yaro

New Zenner

Join Date:
Apr 2012
Posts:
15
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Yaro:

Hello everybody!

I install this Google Analytics on my ZenCart website, 1.3.9, and it seemed that it was installed correctly - at least the "Google Analytics Configuration" appeared in the "Configuration" menu and I was able to insert my GA account number into it. But then it stuck - GA says that ...Tracking Not Installed... and I checked the Page Source - GA tracking code was not there... What did I do wrong?

In order not to duplicate my post, I'm just replying myself to it. Still, looking forward to get some help from gurus of ZenCart!
ZC version - 1.3.9, Google addon - 1.5, I installed it successfully, everything went fine until I saw in GA that "Tracking Not Installed"... how this may happen!? What should be my next steps? De-install the Google Analytics addon? how? Or re-install it? PLS, HELP. My site - Aptekarus.com

Thank you in advance.

The website (I have just launched it) - https://www.aptekarus.com

Thanks in advance for any help!

18 May 2012, 2:49 PM
#1845
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Simple Google Analytics - Support

Yaro:

Jeking, thank you!

I've did everything according to the installation manual, including file changes, I added this code into tpl_main_page.php:

<?php if (GOOGLE_ANALYTICS_TRACKING_TYPE == "Asynchronous") { // Do nothing } else { require(DIR_WS_TEMPLATE . 'google_analytics/google_analytics.php'); } ?> </body>

And I installed the SQL patch (uploaded a file through the ZC admin)

Why the GA code is not showing now?

Make sure you Change the "admin" and "your_template" folder name to match the name of your custom directory and ftp upload to your sever.
Where ever you see the words "your_template" (in either these instructions, or the file folders included with the install)
you should REPLACE that with the directory name that your template is running from. So for example, if you are running a
custom template and the directory that you decided to keep those template files in is called "mycustomtemplate" then, where ever
you see the words "your_template", you would change it to "mycustomtemplate".

    If you are using the default template provided with zen cart, then you would replace each instance of "your_template" with the 
    following: "template_default"

Make sure you insert this code in the body tag in /includes/templates/[your_template]/common/tpl_main_page.php
At the bottom just before the closing </body> tag:

<?php
if (GOOGLE_ANALYTICS_TRACKING_TYPE == "Asynchronous") {
// Do nothing
} else {
require(DIR_WS_TEMPLATE . 'google_analytics/google_analytics.php');
}
?>

The code is not installed on your site yet. Follow the direction for it to show when you view source at the bottom of the page.

18 May 2012, 8:16 PM
#1846
yaro avatar

yaro

New Zenner

Join Date:
Apr 2012
Posts:
15
Plugin Contributions:
0

Re: Simple Google Analytics - Support

countrycharm:

Make sure you Change the "admin" and "your_template" folder name to match the name of your custom directory and ftp upload to your sever.
Where ever you see the words "your_template" (in either these instructions, or the file folders included with the install)
you should REPLACE that with the directory name that your template is running from. So for example, if you are running a
custom template and the directory that you decided to keep those template files in is called "mycustomtemplate" then, where ever
you see the words "your_template", you would change it to "mycustomtemplate".

    If you are using the default template provided with zen cart, then you would replace each instance of "your_template" with the 
    following: "template_default"

Make sure you insert this code in the body tag in /includes/templates/[your_template]/common/tpl_main_page.php
At the bottom just before the closing </body> tag:

<?php if (GOOGLE_ANALYTICS_TRACKING_TYPE == "Asynchronous") { // Do nothing } else { require(DIR_WS_TEMPLATE . 'google_analytics/google_analytics.php'); } ?>
> 
> The code is not installed on your site yet. Follow the direction for it to show when you view source at the bottom of the page.

Thanks so much! I made sure to upload all necessary files to appropriate directories, and now GA code IS installed on my site (<https://www.aptekarus.com>), but Google Analytics says that 'CODE NOT INSTALLED'!!!!! How on Earth can this happen?

Pls, see below the part of the source code of my website with the code installed: 

				Copyright © 2012 <a href="http://aptekarus.com/index.php?main_page=index" target="_blank">APTEKARUS.COM - Russian Holistic Pharmacy in USA</a>. Powered by <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a>		
			<!-- =============================== -->
		</div>
		<div><!-- {%FOOTER_LINK} --></div>
	</div>
</div>



</div>
<!--bof- parse time display -->
<!--eof- parse time display -->

<script type="text/javascript">
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">
var pageTracker = _gat._getTracker("UA-31755790-1");
pageTracker._initData();

pageTracker._trackPageview();
pageTracker._trackPageLoadTime();
</script>
</body></html>
19 May 2012, 2:04 AM
#1847
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Simple Google Analytics - Support

Yaro:

Thanks so much! I made sure to upload all necessary files to appropriate directories, and now GA code IS installed on my site (www.aptekarus.com), but Google Analytics says that 'CODE NOT INSTALLED'!!!!! How on Earth can this happen?

Pls, see below the part of the source code of my website with the code installed:

            Copyright © 2012 <a href="http://aptekarus.com/index.php?main_page=index" target="_blank">APTEKARUS.COM - Russian Holistic Pharmacy in USA</a>. Powered by <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a>        
        <!-- =============================== -->
    </div>
    <div><!-- {%FOOTER_LINK} --></div>
</div>
</div> </div> <!--bof- parse time display --> <!--eof- parse time display --> <script type="text/javascript"> 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"> var pageTracker = _gat._getTracker("UA-31755790-1"); pageTracker._initData(); pageTracker._trackPageview(); pageTracker._trackPageLoadTime(); </script> </body></html>

Yes the code is now installed on your site.
Now go check and make sure you have everything set up right on Google Analytics. Make sure you have setup your Account Settings and Profile Settings correctly.

19 May 2012, 3:38 PM
#1848
yaro avatar

yaro

New Zenner

Join Date:
Apr 2012
Posts:
15
Plugin Contributions:
0

Re: Simple Google Analytics - Support

countrycharm:

Yes the code is now installed on your site.
Now go check and make sure you have everything set up right on Google Analytics. Make sure you have setup your Account Settings and Profile Settings correctly.

Thanks to everyone! Now GA shows "Receiving Data"!

20 May 2012, 12:28 AM
#1849
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Simple Google Analytics - Support

Yaro:

Thanks to everyone! Now GA shows "Receiving Data"!

Your very welcome.

21 May 2012, 9:08 PM
#1850
billyboyle avatar

billyboyle

Zen Follower

Join Date:
Jul 2011
Location:
Glasgow, Scotland
Posts:
115
Plugin Contributions:
1

Re: Simple Google Analytics - Support

Thanks to everyone who already asked questions and equally to those who gave so many excellent answers.
Installed and working fine (I think) just need some traffic and conversions to test it.
Install on Zen cart v 1.5 fresh install with a renewed cleansed database, which was one of the biggest issues I faced with this as the uninstall script did not seem to remove all of the tables and data from the older version I had install on Zen cart 1.3.9.

Thanks again for every one involved.

24 May 2012, 3:02 PM
#1851
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Countrycharm,

You asked:

What version of the Simple Google Analytics tracking are you using?

I have Simple Google Analytics version 1.2.3 installed on my Zencart 1.3.9h. It works in one store but not the other. I will carry out your instructions when I have a bit more time and will let you know the result.

Thanks very much.

Notageek

24 May 2012, 5:17 PM
#1852
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Simple Google Analytics - Support

notageek:

Countrycharm,

You asked:

I have Simple Google Analytics version 1.2.3 installed on my Zencart 1.3.9h. It works in one store but not the other. I will carry out your instructions when I have a bit more time and will let you know the result.

Thanks very much.

Notageek

Yes when you get the time to upgrade to v1.2.5c and follow post 1833 you will be OK.

25 May 2012, 1:14 AM
#1853
hermes369 avatar

hermes369

New Zenner

Join Date:
Dec 2006
Location:
Augusta, GA
Posts:
74
Plugin Contributions:
0

Re: Simple Google Analytics - Support

I'm useless for not having the code in front of me but I just finished updating from 1.3.9h to 1.5 and was having issues with the upgrade SQL file. I had to edit the query manually to add my table prefixes. I'm hardly fluent in MySQL and can't tell if the included query attempts to compensate for this? At any rate, once I tweaked it, I had no problems.

30 May 2012, 3:08 PM
#1854
nightshadow avatar

nightshadow

New Zenner

Join Date:
May 2012
Posts:
28
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Ok so I followed all the instructions in the install.txt except for in my templates folder was no TPL_Main_Page.php... only a header and footer... so I skipped that step and went to admin tools sql patch... I opened the install sql file copied the entire file and pasted to the query box. I hit send. It returned a query result showing me exactly the same code I posted but didnt say anything about errors. But it also didnt say successful or anything like that... my site didnt break I just need to know if analytics is now fully functional and is there a way for me to test that it is?

31 May 2012, 5:19 PM
#1855
nightshadow avatar

nightshadow

New Zenner

Join Date:
May 2012
Posts:
28
Plugin Contributions:
0

Re: Simple Google Analytics - Support

does nobody read this forum?

31 May 2012, 6:09 PM
#1856
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Simple Google Analytics - Support

You're proving to be quite a cheeky fellow...:D. Nobody has a right to DEMAND answers on this forum - even "implied" demands.

Please remember that ALL HELP GIVEN HERE is given for FREE and in good faith. Be patient - or hire a coder to assist you if you don't like these policies.


HOW you install this module will depend on what VERSION of ZC you are using.

If you do not have tpl_main_page.php in your CUSTOM folder (see the module's install.txt instructions) then you need to PUT A COPY of that file into that folder.

Then, you EDIT that COPIED file to put in the lines of code indicated in the instructions.

I trust you have your site's UA-XXXXXXX code ? (That is inserted into the database using the configuration tools for GA in your admin area.)

31 May 2012, 7:39 PM
#1857
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Simple Google Analytics - Support

schoolboy:

You're proving to be quite a cheeky fellow...:D. Nobody has a right to DEMAND answers on this forum - even "implied" demands.

Please remember that ALL HELP GIVEN HERE is given for FREE and in good faith. Be patient - or hire a coder to assist you if you don't like these policies.


HOW you install this module will depend on what VERSION of ZC you are using.

If you do not have tpl_main_page.php in your CUSTOM folder (see the module's install.txt instructions) then you need to PUT A COPY of that file into that folder.

Then, you EDIT that COPIED file to put in the lines of code indicated in the instructions.

I trust you have your site's UA-XXXXXXX code ? (That is inserted into the database using the configuration tools for GA in your admin area.)

nightshadow:

does nobody read this forum?

I agree with Schoolboy!

With that said if you would go back a page or two and read some post I gave, you might just find out how to install this. If you still have problems afterwards I will try to help.

2 Jun 2012, 8:32 PM
#1858
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Countrycharm,

I took the time to upgrade my 1.2.3 to version 1.2.5c of Simple Google Analytics, which basically consisted of removing the code from my includes/templates/mytemplate/common/html_header.php file.

I still cannot see the Simple Google Analytics in my site when I view source, and it is not tracking. I do have the header still installed on my www.m u s i c s t u d i o s t o r e.com website, and it still works.

I followed the following advice, and chose the upgrade. I am running Zen Cart version 1.3.9. Maybe there is actually more to the upgrade than deleting code from the header. Did I miss something?

countrycharm:

Yes when you get the time to upgrade to v1.2.5c and follow post 1833 you will be OK.

One further question relating to Google Analytics itself: I have been trying as a next point of attack to try to figure out exactly when the Google Analytics stopped working on www.g o k a r a o k e m a c h i n e.com, but I cannot figure out how to choose a date range within Google Analytics to obtain this information. There is no calendar showing in the upper right of my Google Analytics screen, and I have searched all morning for how to choose/change the date range.

Do you know how the date range may be changed in the new version of Google Analytics? Perhaps I should go back to the old version where I had this date change capability.

Thanks.

Notageek

2 Jun 2012, 8:46 PM
#1859
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Well, it helps to finally ask a question, because I finally found how to change the date range in the new version of Google Analytics by going to the old version and seeing how that looked.

It turns out the new version removes the date range box so it is pretty far above the hour/day/week/month box. It is by clicking the actual date range box that the calendar comes up. I do not know why it was so hard to figure out in the new version, and I still do not see the option in the menu, but maybe I will find it based on seeing the old version.

Notageek

2 Jun 2012, 9:59 PM
#1860
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Well, once I had identified the date one of my sites stopped showing the Google Analytics code in view source and consequently in Google Analytics, I was able to isolate what I was doing when GA stopped showing, which was to install a module. I actually installed the module on both of my sites, but one site is still being tracked in Google Analytics. I checked the files in that module, and the includes/templates/mytemplate/common/tpl_main_page.php was not changed.

The module works on both websites, so I know it is not the module itself (Links Manager by the wonderful Clyde Jones).

The Links Manager module does have a .sql file, and I recall I did have a bit of trouble installing the .sql file on the site with my current GA problem, and figured out that problem before smoothly installing it on my second site.

I thought I would be able to compare files and find the error. but I am not sure what I would compare. I compared the tpl_main_page.php file with my backup before the GA stopped showing, and they are the same.

In trying to recall what the .sql glitch was, it might have been some wording in the php version that had changed from the prior php version. I'm not sure, though.

So, my question is whether I really should try to just compare all pre-problem files with the current files, maybe starting with the Links Manager files, or whether there is some procedure for looking at the .sql database for some conflicting data. I am having trouble visualizing a system other than just a total review of all website files through WinMerge, pre-problem and post-problem.

Does anyone have an opinion as to whether I am on the right track?

Notageek