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

Simple Google Analytics - Support

Views: 451,130

Results 1,581 to 1,600 of 2,165
25 Jul 2011, 2:35 PM
#1581
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Simple Google Analytics - Support

Golden Synergy:

Thank you. I downloaded your version.
before I start, I am reading your read me. I found this : Step 4
At the bottom of /includes/templates/[your_template]/common/html_header.php. For the life of me I can not find this html_header. php. All my common folders have tpl_header.php but not "html_header.php

Is that created when I add the -install SQL file?

If your custom template does not have this file then you'll want to copy it from the 'default_template' directory into your custom 'common' directory. Alter that file and you're all set.

Remember, where ever you see 'your_template', replace this with the actual name of your own template directory.

25 Jul 2011, 2:46 PM
#1582
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Re: Simple Google Analytics - Support

BlessIsaacola:

I am wondering if you by any chance have an approach you can share that will at least track conversion even if the revenue data is not being tracked. I have tried the conversion code from adcenter and it's not tracking. Here is the code from them that I am currently using:```

<script type="text/javascript"> if (!window.mstag) mstag = {loadTag : function(){},time : (new Date()).getTime()};</script> <script id="mstag_tops" type="text/javascript" src="//flex.atdmt.com/mstag/site/ca8df32c-e586-4f05-8b99-a0fe58e21bd5/mstag.js"></script> <script type="text/javascript"> mstag.loadTag("analytics", {dedup:"1",domainId:"MASKED",type:"1",revenue:"",actionid:"28215"})</script> <noscript> <iframe src="//flex.atdmt.com/mstag/tag/ca8df32c-e586-4f05-8b99-a0fe58e21bd5/analytics.html?dedup=1&domainId=MASKED&type=1&revenue=&actionid=28215" frameborder="0" scrolling="no" width="1" height="1" style="visibility:hidden;display:none"> </iframe> </noscript>


Yes. Take that exact code and put it into the tpl_main_page.php file near the bottom (just above or below the "google analytics" require file.

Insert it as follows to only show on the checkout_success page and you should be ok.

```php
<?php 
/************* bof AdCenter Tracking Code ********************/
if($page_directory == 'includes/modules/pages/checkout_success') { ?>



INSERT YOUR TRACKING CODE HERE





<?php 
}
/************* eof AdCenter Tracking Code ********************/
?>
25 Jul 2011, 6:16 PM
#1583
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Simple Google Analytics - Support

econcepts:

Yes. Take that exact code and put it into the tpl_main_page.php file near the bottom (just above or below the "google analytics" require file.

Insert it as follows to only show on the checkout_success page and you should be ok.

<?php /************* bof AdCenter Tracking Code ********************/ if($page_directory == 'includes/modules/pages/checkout_success') { ?>

INSERT YOUR TRACKING CODE HERE

<?php } /************* eof AdCenter Tracking Code ********************/ ?>

Thanks! I will give this a try. I actually have the code currently placed in the checkout_success file and perhaps that's a wrong approach. I wonder how it populates the revenue if there's no variable that's defined for it.

Thanks!
25 Jul 2011, 7:17 PM
#1584
golden_synergy avatar

golden_synergy

Zen Follower

Join Date:
Aug 2009
Location:
Westland, Michigan
Posts:
107
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Since my file Is not matching what your read me said "find the line of code that looks like this:

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

Is the area in red below the line I should replace?

</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 --> </body>
26 Jul 2011, 3:13 PM
#1585
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Re: Simple Google Analytics - Support

BlessIsaacola:

Thanks! I will give this a try. I actually have the code currently placed in the checkout_success file and perhaps that's a wrong approach. I wonder how it populates the revenue if there's no variable that's defined for it.

Thanks!

It will not populate the revenue figure if you do not provide one. To do this you'll need to write more programming code in order to read the order total on the thank you page and insert it into the proper slot within the tracking.

26 Jul 2011, 3:14 PM
#1586
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Re: Simple Google Analytics - Support

Golden Synergy:

Since my file Is not matching what your read me said "find the line of code that looks like this:

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

Is the area in red below the line I should replace?

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

If you have never installed the module before then your template will not have that line of code. You want to follow the portion of the readme for new installs ... not upgrades. It looks as if you are reading the upgrade section.

You definitely do not want to alter any pre-existing code on the page (especially anything to do with the footer file.) This will likely break the site.

This goes without saying, but before you make any changes, make a BACKUP of all files you are going to alter so you have an easy way of returning to the beginning if you need to.

3 Aug 2011, 3:08 PM
#1587
gertzy avatar

gertzy

New Zenner

Join Date:
Feb 2010
Posts:
40
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Something is very odd for me.

I have moved my shop from a host who ran it on an old version of ZC like 1.3.7 or something to a new host and its running on 1.3.9h.... Looked at analytics and realised that it stopped recording on that very day of change. Then realised I had to put on analytics.. So I have gone ahead and installed SGA.

Its been working fine. Stats going back for years, and then zeros for a little while..

When prodding on the GA website.. I see that there is a old interface and a new beta interface..

In the old interface, there is this green tick showing 'receiving data'... In the new interface, n the tracking code page it says this... 'Tracking Not InstalledLast checked: 09-Nov-2008 12:34:03 PST'... Thats like 3 years ago... So mybe there is a bug in the new interface... No idea how to make it check now that I have installed the code onto my site..

One other thing, bac to the old interface. There are 2 entries for my domain, one current with lots of stats, and one old UA code that was used by a previous company yers ago... But.. That old UA code is also showing as green tick with receiving data... But.. Its not... The old code does not exist in a single place on my zen cart.!! very odd.!!

3 Aug 2011, 6:11 PM
#1588
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Re: Simple Google Analytics - Support

Gertzy:

Something is very odd for me.

I have moved my shop from a host who ran it on an old version of ZC like 1.3.7 or something to a new host and its running on 1.3.9h.... Looked at analytics and realised that it stopped recording on that very day of change. Then realised I had to put on analytics.. So I have gone ahead and installed SGA.

Its been working fine. Stats going back for years, and then zeros for a little while..

When prodding on the GA website.. I see that there is a old interface and a new beta interface..

In the old interface, there is this green tick showing 'receiving data'... In the new interface, n the tracking code page it says this... 'Tracking Not InstalledLast checked: 09-Nov-2008 12:34:03 PST'... Thats like 3 years ago... So mybe there is a bug in the new interface... No idea how to make it check now that I have installed the code onto my site..

One other thing, bac to the old interface. There are 2 entries for my domain, one current with lots of stats, and one old UA code that was used by a previous company yers ago... But.. That old UA code is also showing as green tick with receiving data... But.. Its not... The old code does not exist in a single place on my zen cart.!! very odd.!!

None of those interfaces has to do with any of Simple Google Analytics or Zen Cart.

That is all on the Google end (the interface) and is only used to view the Google stats (on the Google end) in either their new interface layout or their old one.

Having said that, if your tracking seems off, my guess is that when the site was upgraded, something was overwritten in how the Simple Google Analytics module sends data to Google.

In short, if you are getting data (don't even worry about the old interface and what any of those account says) in your Google Analytics side, then it should all be ok.

3 Aug 2011, 9:18 PM
#1589
larkin1981 avatar

larkin1981

New Zenner

Join Date:
Mar 2011
Posts:
10
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Hi, I just installed the Simple Google Analytics Mod on my website for the first ime, which is running Zen Cart v1.3.9h. But I'm having a bit of trouble with the customization steps that are listed in the Readme file. In Step 3, Part B where it instructs to insert the given code into the /includes/templates/[your_template]/common/html_header.php directory of the website, I've run into the issue of my site not having a html_header.php file. I'm running the cherry zen template on my site and am wondering how I should proceed with the install from here on? Thanks in advance for any advice anyone can offer.

4 Aug 2011, 12:14 AM
#1590
gertzy avatar

gertzy

New Zenner

Join Date:
Feb 2010
Posts:
40
Plugin Contributions:
0

Re: Simple Google Analytics - Support

larkin1981:

Hi, I just installed the Simple Google Analytics Mod on my website for the first ime, which is running Zen Cart v1.3.9h. But I'm having a bit of trouble with the customization steps that are listed in the Readme file. In Step 3, Part B where it instructs to insert the given code into the /includes/templates/[your_template]/common/html_header.php directory of the website, I've run into the issue of my site not having a html_header.php file. I'm running the cherry zen template on my site and am wondering how I should proceed with the install from here on? Thanks in advance for any advice anyone can offer.

Go find the html_header.php file in the default header common folder, and make a copy of it in your Cherry Zen common folder... then edit it there...

4 Aug 2011, 4:48 PM
#1591
henrygale avatar

henrygale

New Zenner

Join Date:
Aug 2011
Posts:
2
Plugin Contributions:
0

Re: Simple Google Analytics - Support

I've run into an odd problem implementing Simple Google Analytics. When I finished all the installation steps in the readme, I found that my shop main page was loading completely blank, only the black background is visible.

I tracked the problem down to the code in tpl_main_page.php. When I add the code:

<?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');
}
?>

to my tpl_main_page.php, my main page goes blank. When I remove it, it works again.

Any ideas? I'm using the default tpl_main_page.php, as my template didn't have one. So this code is the only change from the Zen Cart default.

Thanks in advance!
HG

4 Aug 2011, 6:55 PM
#1592
larkin1981 avatar

larkin1981

New Zenner

Join Date:
Mar 2011
Posts:
10
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Gertzy:

Go find the html_header.php file in the default header common folder, and make a copy of it in your Cherry Zen common folder... then edit it there...

That causes a 500 error because it's not a standard file for the cherry zen template.

Has anyone successfully integrated the Simple Google Analytics mod while using the Cherry Zen template? If so, how did you do it with that html_header.php file not existing?

8 Aug 2011, 12:20 PM
#1593
bobthemolder avatar

bobthemolder

Zen Follower

Join Date:
Nov 2008
Posts:
164
Plugin Contributions:
0

Re: Simple Google Analytics - Support

larkin1981:

That causes a 500 error because it's not a standard file for the cherry zen template.

Has anyone successfully integrated the Simple Google Analytics mod while using the Cherry Zen template? If so, how did you do it with that html_header.php file not existing?
It doesn't matter whether it's a standard cherry-zen template file - files that aren't modified by default in the cherry-zen are taken from the template_default folder - it should not cause any problem whatsoever to copy the exact file over.

Are you sure you're dropping it into the right folder in your template?
Have you tried dropping it into the template folder without modifying it first?

8 Aug 2011, 3:43 PM
#1594
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Re: Simple Google Analytics - Support

HenryGale:

I've run into an odd problem implementing Simple Google Analytics. When I finished all the installation steps in the readme, I found that my shop main page was loading completely blank, only the black background is visible.

I tracked the problem down to the code in tpl_main_page.php. When I add the code:

<?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'); } ?>
> 
> to my tpl_main_page.php, my main page goes blank. When I remove it, it works again.
> 
> Any ideas? I'm using the default  tpl_main_page.php, as my template didn't have one. So this code is the only change from the Zen Cart default.
> 
> Thanks in advance!
> HG


A blank page means there is an error in your PHP code somewhere. Typically this happens when one inadvertently alters other code or places the php code listed in such a way where it mess with current code on the site.

To find out where your problem is make sure you have error checking turned on (default in 1.3.9 versions but if you don't have that you can download the error checking file "Debug Error logging").

To find out where the error is then, place your code back on the page and then try to access it. When you get the white page an error log will be written to your 'cache' folder (with the date / time ... this is how you tell which log goes with which action. If there are too many you can delete the error logs and repeat the above step so there is only one in there when needed.)

Open that error log and it will tell you the exact issue and line of code to look at. If you can;'t figure out what the error means, post it here and I'll walk you through it.
8 Aug 2011, 3:47 PM
#1595
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Re: Simple Google Analytics - Support

larkin1981:

That causes a 500 error because it's not a standard file for the cherry zen template.

Has anyone successfully integrated the Simple Google Analytics mod while using the Cherry Zen template? If so, how did you do it with that html_header.php file not existing?

This module works with all templates no matter where they come from or who built them.

If you get 500 error you did something wrong in moving the file.

Cherry zen actually does use the html_header.php file in the default folder (all template must for them to work) so by moving it you must have incorrectly placed it.

What you want to do is take the following file:

/includes/templates/template_default/common/html_header.php

copy that to the following location

/includes/templates/[insert your template name here]/common/html_header.php

After you have moved it there make your changes and upload.

If all has been done correctly, it should work just fine with no issues.

16 Aug 2011, 8:33 PM
#1596
dmagic avatar

dmagic

Totally Zenned

Join Date:
Oct 2008
Posts:
594
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Hello there

can you help me please ,
all installed very well ( i think)

but i see : Tracking Not InstalledLast checked: Mar 26, 2011 12:30:39 PM PDT
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.

and i ask , why ?

https://www.king-magic.com

17 Aug 2011, 12:26 AM
#1597
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Re: Simple Google Analytics - Support

Looking at your site and viewing the source code it appears that you have 2 - 3 different snippets of Google Analytics installed on the pages. You should only have one.

Remove all those you don't need and only let the Module add it.

Once that is complete, go back and re-verify the tracking with Google.

That should do it.

4 Sep 2011, 11:32 AM
#1598
centec2b avatar

centec2b

New Zenner

Join Date:
May 2008
Posts:
52
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Hello - has anyone had experience of this issue when doing a clean install

I am installing onto my test system prior to installing on the live version and I keep getting a sql syntax error when trying to install the SQL file

#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 '

PRIMARY KEY (languages_id),

KEY idx_languages_name_zen ('name')

) TYPE=M' at line 5

I have looked at the MySQL reference but have to confess I got somewhat lost

I am using Zen Cart 1.3.9h
Database Patch Level 1.3.9h
PHP 5.3.5
Mysql 5.5.8

I have searched the thread and the forum and am perplexed that there doesnt seem to be others who have experienced the problem

Any help gratefully received

Thank you

Centec2b

4 Sep 2011, 2:37 PM
#1599
raider1016 avatar

raider1016

New Zenner

Join Date:
Jul 2009
Posts:
7
Plugin Contributions:
0

Re: Simple Google Analytics - Support

i believe i have added everything correct. I receive no errors of any kind and even analytics says its receiving data. In fact, my traffic dropped to 0 so i know its not calculating my traffic. Also, when i view my source code on any page in the site, i cannot see any code relating to google analytics.

i am using the "iC_AcadameV1.2" template along with the latest version of Zen Cart.

i also had to copy the "html_header" into my iC_AcadameV1.2 template folder because it was not there.

Anyone got any ideas?

5 Sep 2011, 10:50 PM
#1600
centec2b avatar

centec2b

New Zenner

Join Date:
May 2008
Posts:
52
Plugin Contributions:
0

Re: Simple Google Analytics - Support

Centec2b:

Hello - has anyone had experience of this issue when doing a clean install

I am installing onto my test system prior to installing on the live version and I keep getting a sql syntax error when trying to install the SQL file

Hello reference my original post #1600. I am assuming the problem is within my setup on the test system, rather than a code error, due to the overwhelming number of successful users.

But it still seems odd that no one else has had a problem

To try and locate the problem I have updated to the latest version of xampp for win 32 1.7.4

Rewritten the code into a new sql file

Neither have any beneficial effect

I guess the next step is to try and cross reference against other SQL instructions

I have an odd feeling I am going to kick myself when the reason for the error becomes apparent!

Centec2b