Google

Installing Google Analytics in your ProStores Site Video Tutorial

Written on:July 11, 2009
Comments
Add One

Post to Twitter

I have added update Google Analytics code from Google below the video!

This brand new video tutorial will lay out the steps for installing Google Analytics in your ProStores site. Without exception if you own a ProStores store you MUST have Google Analytics installed, if you don’t you won’t be as effective with your site as you could be. Google Analytics provides the data that you can take and use to better understand where your visitors are coming from, what they are doing on your site, and why they are or aren’t turning into customers.

I hope this video tutorial will help you learn to install Google Analytics in your ProStores site.

Installing Google Analytics in ProStores from Matthew Montgomery on Vimeo.

*UPDATE* You can install this in the Footer OR in the header thanks to Google’s most recent update to the code. Eventually I’ll update the video with that information too.

Google Analytics Code – Install in the Header OR Footer Template

<!-- Begin Google CODE -->
<ss:if test="$page.bodytemplate.name = 'orderconfirm'">
<ss:comment>do nothing</ss:comment>
<ss:else/>
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-xxxxxxx-x']);
  _gaq.push(['_trackPageview']);
  (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';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
  })();
</script>
</ss:if>
<!-- End Google CODE -->

Google Analytics Order Confirmation Code – This code tracks your sales and inputs them into GA.

<!-- Begin Google ORDER CONFIRMATION CODE -->
 <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-xxxxxxx-x");
    pageTracker._initData();
    pageTracker._trackPageview();
   </script>
 <script type='text/javascript'>
  pageTracker._addTrans(
   "<ss:value source="$invoice.confirmationNumber" />",
   "x",
   "<ss:value source="$invoice.storeSubTotal"/>",
   "0",
   "0",
   "<ss:value source="$invoice.billToCity"/>",
   "<ss:value source="$invoice.billToState"/>",
   "<ss:value source="$invoice.billToCountry"/>"
  );
  <ss:foreach item="detail" within="$invoice.details">
  pageTracker._addItem(
   "<ss:value source="$invoice.confirmationNumber"/>",
   "<ss:value source="$detail.sku"/>",
   "<ss:value source="$detail.product.name"/>",
   "<ss:value source="$detail.product.oem"/>",
   "<ss:value format="none" source="$detail.price"/>",
   "<ss:value source="$detail.quantity"/>"
  );
  </ss:foreach>
  pageTracker._trackTrans();
 </script>
  
<!-- End Google ORDER CONFIRMATION CODE -->
Order Confirmation Code

I do realize that the code above may run off the side a bit, but you should be able to copy it anyway. Just click at the top of the code and drag it down and it will grab it all.

If you have any questions or problems please e-mail me at matt@onetakemedia.net or leave a comment.


Also, read the first three parts to my 4 part series on Advanced Google Analytics for ProStores

Part 1 – Google Analytics Filters – ProStores Setup
Part 2 – Google Analytics Goals
Part 3 – Advanced Segmentation
Part 4 – Custom Reporting – Coming Soon!

Parts 1-2 will coming to video very soon!

Thank you,
Matthew Montgomery

Post to Twitter

17 Comments add one

  1. Pingback:Installing Google Analytics in your ProStores Site Video Tutorial …- Suwarto Dot Com

  2. Pingback:Installing Google Analytics in your ProStores Site Video Tutorial …- SFWEBDESIGN.com

  3. Thank you very much for the tutorial and attached code. Easy to follow and installed in minutes. I wish you all the best.

  4. Great video! Can you explain how to set up the internal site search for a prostores site? What “query parameters” should be used?
    Thanks!

  5. Matt says:

    Hello! are you referring to: A. the product search inside the ProStores Admin?, B. the search on the storefront that comes with your store?. or C. asking about integrating Google’s site search code into your ProStores code?

  6. Hi Matt,
    I’m thinking B and possibly C. I want to be able to analyze the searches that visitors are making on my prostores site.

    When you go into google analytics, it asks for some query parameters (s, q, etc – which one does the site use?) Since Prostores doesn’t used any of these, and the search is handled dynamically (invisibly) to the visitor it is not possible to capture.

    I talked to another web analytics expert that suggested that we need to modify the code to something similar to this…

    pageTracker._trackPageview();

    If the page is showing search results, then this prostores value is non-empty string:

    So in this case, instead of the original GA line, we would output this:

    pageTracker._trackPageview(document.location.href + “?search=” + + “)”;

  7. Eric Katz says:

    I seem to still be having issues with proper tracking of all my customers. I suppose a large chunk of visitors either do not have javascript enabled or I’m doing it wrong.

  8. Matt says:

    How are noticing that you are missing customers?

  9. Rick Noel says:

    Hi Matt,
    I too am trying to set up site search for a clients Prostore site. In GA > Analytics Settings > Profile Settings > Edit Profile Information
    I don’t know what to include in the required field Query Parameter field. I assume this is the string that GA recognizes as a search, but when doing a site search from a ProStore site, no query paramters show up – just http://www.yourprostore.com/servlet/Categories
    Thanks,
    Rick

  10. Matt says:

    I’ve only briefly glanced at the Site Search part of GA, I don’t know that its possible to do that. mostly because of the reason you’ve noted, its a database driven search that cloaks the parameters, or doesn’t use them in the way we would typically understand them. In the end the result is that GA can’t track the site search. There are the successful/unsuccessful searches reports in the Reports tab in your Store administration, so at least there is that.

  11. To track site search in GA simply change the form method from post to get and it will show the search terms in the url with the parameter “keyword”.

  12. Matt says:

    Do you currently have this implemented on your store?

  13. Hello:
    Thank you so much for the above help! It was wonderfully easy!
    I have one question, when I check my reports in Analytics it shows that none of the orders came from Keywords. Yet when I check my AdWords page it shows conversions for some of the Keywords shouldn’t they coincide?
    Regards,
    Christina

  14. Matt says:

    could be a few reasons for that, 1. Google AdWords isn’t correctly hooked up to Google Analytics, 2. you filtered out paid keywords by accident when looking at your Keywords section in Google Analytics, 3. something else that i’m not thinking of since I’m not looking directly at your Analytics and AdWords accounts. ;-)

  15. Hi Matt:
    Thanks for answering my question so quickly!

    How would I know if the Google AdWords and Analytics are or aren’t hooked up?

    I will look into the filter if i filtered out the paid keywords, thank you again.

    Regards,

    Christina

  16. Matt says:

    Here is the guide to connect AdWords and Analytics together. http://www.google.com/support/analytics/bin/answer.py?answer=55507

Leave a Comment

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>