Now it works.
the problem is that after paying with paypal the user has to redirect to checkout success page otherways Analytics won't track the Purchase.
Now it works.
the problem is that after paying with paypal the user has to redirect to checkout success page otherways Analytics won't track the Purchase.
Wow, the included installation file has to be the worst one I have seen!
Step 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):
Ok...what code?
I give up. I cannot install this with the shoddy instructions!
Well, keep in mind that this mod is FREE so bashing the developer is not usually the easiest way to get support. I understand you're frustrated with the installation instruction but there's a better way to communicate that than how you're going about it. Obviously, there are 1,000s of site using this successfully (including ours) so the installation instruction cannot be that bad.Wow, the included installation file has to be the worst one I have seen!
Which version of the mod are you trying to install? 1.2.5c? Which version of Zen Cart are you running? 1.3.9 or 1.5.0?
Here here!!! Absolutely not the right way to go about asking for help around here..While the instructions are not the best, they aren't that unclear either.. As you pointed out 1000s of other site couldn't be running this add-on if they were COMPLETELY unclear..
That said to address kezerb's issue this should help:
If your template doesn't include this file simply copy it from the default_template folder to your template. (See Zen Cart FAQs on the template override system if you need an explanation why you need to do it this way)At the bottom of /includes/templates/[your_template]/common/tpl_main_page.php copy and paste the following lines of code just before the </body> tag:
Code:<!--bof- Google Analytics Code --> <?php if (GOOGLE_ANALYTICS_TRACKING_TYPE == "Asynchronous") { // Do nothing } else { require(DIR_WS_TEMPLATE . 'google_analytics/google_analytics.php'); } ?> <!--eof- Google Analytics Code -->
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
Figured I would post this updated information here.
This might be important if you pay attention to google analytics bounce rate. I utilize several comparison shopping engines and some shoppers hit the one item, read the description, etc. and leave. While 'technically' a bounce, it isn't really.
Google has updated their analytics code to allow for better tracking in these types of situations.
Here is the article posted on Googles blog with the code.
The updated code is in BOLD.
Link to original article.
Tracking Adjusted Bounce Rate In Google Analytics
Wednesday, July 25, 2012 | 9:00 AM
Labels: Code and Configuration
Have you ever wondered how many visitors really pay attention to your website before exiting the page? Have you wondered how many of those “bounced” visitors will remember where they’ve been in future? How many of them are totally useless, how many are not?
There is a way to track this!
“Bounce rate” in Google Analytics is one of the key metrics that helps to evaluate the quality of your traffic. “Bounce” happens when the visitor exited the website right from the landing page, without going to any other page. This is a great indication on how relevant the content was for the user and how engaged they were with your website.
While working perfect for most websites, there are categories of sites where this metric is not enough.
Imagine you’re promoting a blog post that describes all the benefits of your company. The visitor might read the whole post and remember your company and products really well - they might even go to search for your product on one of the search engines straight away. However, since the visitor only looked at 1 page (exactly where the blog post is) they will be recorded as bounced visitor.
Another example if you have a description of the product right on the landing page, and your phone number on the same page. The visitor might study the description and call straight away - again, they will be recorded as a bounced visitor, as only 1 page was viewed. There are many more examples, and even traditional websites may benefit from the method described below as opposed to the standard bounce rate.
There is a solution to this - something that we call “Adjusted bounce rate”. You implement a small tweak to your Google Analytics code, which executes an event when a user has spent over a certain amount of time on the webpage. Depending on the website, the time can range from 10 seconds to few minutes - you should decide for yourself the amount of time you consider the user to be sufficiently engaged with your website or product.
Once the event is executed, the visitor is no longer counted as “bounce,” even though no additional pageview is recorded. This will mean your bounce rate will show users who have not spent a required “minimal time” on your website - the ones who have really bounced. Here is a modification to the Google Analytics code that you need to make (on the example of the latest, asynchronous code):
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-1']);
_gaq.push(['_trackPageview']);
setTimeout("_gaq.push(['_trackEvent', '15_seconds', 'read'])",15000);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
The setTimeout function is the one that does the trick here, and you can set it up to whatever delay you wish (in this case, it is 15 seconds).
Moreover, since the event is created once 15 seconds lapse, you can define this event as a goal in Google Analytics, and even import this goal as a conversion to AdWords, provided the conditions are met.
We hope this small fix will allow you to track and understand the users’ behavior and quality of the traffic coming to your website more accurately, and make more informed decisions. One thing website owners should be vary of, though, that not only the function may slow down the users' experience, even insignificantly, but will also increase the volume of hits your site sends to Google Analytics, which might bring your usage over the limit (currently set at 10 mln hits per month). As such, this fix should only be applied when necessary and justified by the concept of the website and the landing pages.
Posted by Alexey Petrov, Google Analytics Insights Team
In regards to the above article, It looks like it should be added to /includes/templates/<my template>/googleanalytics/google_analytics.php around line 107/108
_gaq.push(['_trackPageview']);
_gaq.push(['_trackPageLoadTime']);
setTimeout("_gaq.push(['_trackEvent', '15_seconds', 'read'])",15000);
but this has not been tested yet.
Last edited by Limitless; 28 Jul 2012 at 01:08 AM.
Limitless... Awesome data.. thanks for sharing!!
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
Hi,
Thank you for this module. I have installed and configured (a new install - never installed on our site before), but I have some questions that I can't find answers to in this thread. I'm sure they must be here somewhere but I'm struggling to find them.
Very simply, we want to track the cart value of each conversion. As I understand it, this module will allow us to do this.
I have stripped out all our old analytics code which was in html_header.php (this was where we put it prior to installing this module).
I have stripped out all our old analytics conversion tracking code which was in define_checkout_success.php (this was where we put it prior to installing this module)
I have added the code for this module as instructed to tpl_main_page.php
In the config section I have ...
1) added our Analytics Account ID
2) activated AdWords tracking
3) added our Google AdWords Conversion Tracking Number
Questions...
1) Google Tracking Code Type To Use ... which type do we use to best achieve what we want to do (that is, record the cart value)?
2) Add Custom Tracking After Main Analytics Code? ... do I need to enter something here to get AdWords to capture the cart value?
3) Is there anything else we need to do to be able to record the cart value of each conversion? For example, at present in our Google AdWords account under Tools & Analysis > Conversions, we have defined a conversion type for 'value of order' and entered a "Conversion value" which is currently set to "order_total" so Google knows what it is looking for.
We are using 1.3.9h
Thanks
Last edited by Dunk; 10 Aug 2012 at 03:57 PM.
Sorry I should add that I'm asking on behalf of our marketing agency. They have just taken over management of our AdWords campaigns but need to know what the zen cart "cart value" identifier is so they can properly track the value of each conversion. They thought it was "order_total" but we're not sure.
Bookmarks