Create an account to edit articles | See Formatting Syntax for Wiki syntax | We look forward to your contribution!
You are here: The ProductCart Encyclopedia » Widgets, snippets, add-on's, and more » Third Party Integrations » ProductCart & Google Analytics » Built-in integration with Google Analytics
Built-in integration with Google Analytics
Overview
Google Analytics has been integrated into ProductCart starting with v4.5. Unlike with previous versions of ProductCart, you no longer need to add any code to the storefront. Simply enter the profile ID of the Web site that you wish to track, update the store settings, and you are done.
Locating your Google Analytics profile ID
- Log into Google Analytics
- On the start page, locate the Web site that you wish to track: the Profile ID is shown right next to the URL and looks like this: UA-XXXXXX-X
- The Profile ID is unique for each Web site that you are tracking through Google Analytics (the last digit changes).
Entering the Google Analytics Profile ID in ProductCart
- Log into your ProductCart Control Panel
- Select Settings > Store Settings > Miscellaneous
- Scroll down to the Google Analytics section
- Enter your Profile ID
- Click on the Save Settings button at the bottom of the page
Upgrading to v4.5 from a previous version: remove existing tracking code
If you are upgrading from a previous version of ProductCart, you might have previously added the Google Analytics code to your Web store footer (in either footer.asp or inc_footer.asp). Make sure to remove that code to avoid loading the tracking code twice.
Upgrading from ProductCart v4.x
- Download the file inc_footer.asp from the pc folder
- Open inc_footer.asp
- Locate the Google Analytics tracking code
- Remove the code, which typically looks like this:
<script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-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'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> - DO NOT REMOVE the line of code
<!--#include file="inc-GoogleAnalytics.asp"-->
- Save the file
- Upload the edited file back to the “pc” folder in your storefront
Upgrading from an earlier version
The Google Analytics code was probably added to the file footer.asp
- Download the file footer.asp from the pc folder
- Open footer.asp
- Locate the Google Analytics tracking code, which typically looks like this…
<script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-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'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> - Remove the code
- Save the file
- Upload the edited file back to the “pc” folder in your storefront
Trace: • Product Preferences • Download QWC File • The ProductCart Synchronizer Wiki • ProductCart Synchronizer - v1.08 Update Instructions • quickstart • How to Update a Customized Store • ProductCart v4.1 - Service Pack 2 • ProductCart v4.5 Update Guide • ProductCart 4 Developer's Corner • Built-in integration with Google Analytics