All Collections
Best Practices
Setting Up Google Analytics (legacy and GA4)
Setting Up Google Analytics (legacy and GA4)

How can I set up get google analytics

Dan McCarty avatar
Written by Dan McCarty
Updated this week

Temporary Methods

Due to changes in how Google Analytics works, and the associated tag code, we have temporary methods of enabling analytics on your CrystalCommerce site. When we can, we'll get the integration page working again.

There are two methods to enable Google Analytics at this time, without using the integration normally available in the CrystalCommerce admin:

Easier method, for basic analytics tracking:

Go into your Admin > Advertising > Ad Network, enable the checkbox, then in the code field you can paste your GA4 Google tag. Save the settings and then within a day or less you should have data coming into your Analytics account (assuming you correctly set up your analytics per Google's official documentation). If you had UA / legacy analytics and it isn't working, you could put the UA Google Tag code in the same place as noted above, to get it working again (you would only do this if your GA4 is connected to your old UA tag. If you did GA4 completely separate, you don't need your UA anymore.) If desired, you can also enable GTM to extend the possibilities of data and metrics tracking. See also method two, below:

Complex method, allowing more advanced tracking, if desired:

Use Google Tag Manager (GTM) to add your analytics tag. Set up GTM and then add a tag and put in the analytics Google tag. Then put your GTM container ID in the field in Admin > Integrations > Google Analytics. The GTM container and contained tags will load when your site loads, so the Google Tag script would be included and then analytics should begin collecting data. NOTE: This method is actually the best one, because it allows you to add complex tracking capabilities via advanced tags. For that, you'll need to use Google's official documentation, or hire an analytics expert who can program the tags that you'd like for various metrics.

FOR NOW, PLEASE IGNORE EVERYTHING BELOW ON THIS PAGE, AS THE NORMAL INTEGRATION APPEARS TO NOT BE WORKING IN ALL CASES


Sign Up for Analytics

Important notes:

  1. We do not currently have support for Google Analytics 4 as a new set up. If you want GA4, you must use or already have a legacy GA account and ID (which you can then link up to GA4, as noted later in this article.) We hope to eventually have native support for GA4.

  2. GA works in tandem with GTM (Google Tag Manager). You set up "tags" in GTM which allow GA to track various events on your website. Generally, if you have access to your GA account, you should also have access to your GTM account.

  3. If you are migrating from Legacy GA to GA4, and if you have any "tags" in GTM associated with your legacy GA, you will need to migrate those GTM tags (and make any necessary changes to them) to be associated with GA4, to ensure all of the data continues to be tracked. This is a complex subject and may require you to consult an expert.

Legacy Analytics

Use your Google Apps account login or Gmail login to set-up Google Analytics. Go to www.google.com/analytics and "Sign Up Now."

Follow the process which Google will guide you through.

Get your Analytics ID from Google after setting it up.

In your CrystalCommerce admin, go to Account > Integrations > Google Analytics.

Enter your Google Analytics ID into the relevant field on that page.

Save your changes.

Google Analytics 4

Currently, the only way to set up GA4 on CrystalCommerce is to migrate an existing / legacy analytics account while using the already existing code (“Google tag”) which we have in your website.

Please do NOT set up a new GA4 analytics tag to replace the legacy analytics tag, because we cannot put that into your site.

Please follow the instructions in this GA4 Google help article which explain how to set up GA4 while still using the legacy tag code already on your site. Please read the entire article, but pay special attention to the section with the option to “Use the Google tag found on your website (Recommended)” when setting up your Google tag.

Also see the Google Tag Manager notes below, regarding migration.

Google Tag Manager (related to Google Analytics)

GA works in tandem with GTM (Google Tag Manager). You set up "tags" in GTM which allow GA to track various events on your website. Generally, if you have access to your GA account, you should also have access to your GTM account.

If you are migrating from Legacy GA to GA4, and if you have any "tags" in GTM associated with your legacy GA, you will need to migrate those GTM tags (and make any necessary changes to them) to be associated with GA4, to ensure all of the data continues to be tracked. This is a complex subject and may require you to consult an expert.

Notes about Google Analytics and how it currently works on CrystalCommerce:

Your legacy Google Analytics ID can be added or modified in your admin, if needed. Log in to your admin, then go to Account > Integrations > Google Analytics.

Currently, you can enter your legacy Google Analytics ID in that area, and we automatically output the ID into the global code template of your site, which is set up with the legacy analytics Google tag. The legacy tag is different from the GA4 tag, and we cannot currently change it because it is used globally across all client sites. That’s why you need to follow the instructions at the link above to use the existing Google tag and connect it to GA4.

In accordance with the point above, do not change the Google Analytics ID in your admin to a GA4 ID (if you do, it may not work).

FAQ

CrystalCommerce helped set up my GA and GTM in the past. How do I migrate everything?

This is a complex situation and will require you to do some investigation to determine who has access to your GA and GTM accounts, what the login info is, and so on. If you can't find any access, contact us and we can investigate to see if we have any info.

After you figure that out and get access to your accounts, generally the process would be for you to hire an expert who knows how to migrate GA and GTM to GA4, since we no longer have an analytics expert on staff. If you'd like, we can recommend an expert. Be sure to share the info with them from this article with an extra emphasis on the point that they must set up a GA4 account which utilizes the legacy GA tag already on your CrystalCommerce site. If they set up an all new GA account solely with GA4 and it isn't associated with your existing legacy GA tag, it won't work. And remind them that they will need to migrate any existing GTM tags to GA4-compatible tags.

Resources:

For more information on Google Analytics you can read this article from our knowledge base or sign up for one of Google's Analytics courses.

Did this answer your question?