Google Analytics

Track each visitor and order through this turnkey integration with Google Analytics 4. Follow the directions below to set up your integration, and start tracking sales back to your Google Analytics Dashboard today!

This integration is one of three analytics integrations you can set up for your SamCart Marketplace. To set up similar tracking for Meta or Google Tag Manager, click the links below to visit those help articles. 

Add Your Google Analytics Measurement ID

The first thing you need to do is connect your SamCart Marketplace with your Google Analytics Dashboard. To do this, click on the Settings tab in the left-hand sidebar of your SamCart Marketplace. 

Then scroll down until you see the analytics integrations for Meta, Google Analytics, and Google Tag Manager. Toggle the Google Analytics integration to On. Copy your Google Analytics Measurement ID into the space provided, then click Save Changes

If you need help finding your Google Analytics Measurement ID, please click here for a Google help article that will walk you though the steps.

Firing Events Back To Google Analytics

SamCart will automatically start firing a number of different events back to your Google Analytics Dashboard. Most notably, SamCart will track the following events...

  • Page View: Each time a visitor loads a checkout, or an upsell page, this event will fire. 
  • Add Payment Info: When a user submits their order, but before the charge is successful, this event will fire. 
  • Purchase: When a customer's credit card is charged, this even will fire. This means that throughout a single order, multiple purchase events could potentially fire (depending on whether you are offering One Click Upsells or not).

In addition to the above, SamCart will also track things like scrolls, interacting with a form, button clicks, and more. Each event will carry different data back to Google, and most importantly - whenever a purchase event is fired, SamCart includes a ton of data about the customer, the products they purchased, how much money was collected, and more!

Testing Your Google Analytics Events

To confirm that your Google Analytics pixel is correctly added to your SamCart checkouts, add the Google Tag Assistant plugin to your browser. This plugin is marked as "deprecated," but is still in working order. 

Open any SamCart checkout, and look at the browser plugin to see if the right Google Analytics tag is correctly added to the page. In the screenshot below, multiple Google Analytics tags are active on the page (including the one ending in "...4XDZ", the same measurement ID entered in the Marketplace Settings in the example above). 

You may also wish to use the Google Tag Assistant to test this integration. Visit the Tag Assistant, and click Add Domain. Copy and paste the URL for any SamCart Checkout you have created. 

After clicking Connect, Google will open your checkout in a new tab. You will see a window on the checkout page that confirms Google Tag Assistant is connected and tracking events on the page. 

As you click, scroll and buy you will see different events tracked back to your Google Tag Assistant!

You can also visit your Google Analytics Dashboard and view the Realtime report. While not always immediately updating in true real time, you should be able to see active visitors by location, events as they fire, and more as SamCart sends data back to your Google Analytics Dashboard. 

Remove Any Duplicate Pixels

If you have your Google Analytics tracking script embedded in the header or footer of your SamCart pages, you should remove those scripts to avoid any duplicate information being sent to Google. There are two places to check for extra scripts you may have embedded on your checkouts...

First, head to your Marketplace Settings. Check for any GA script in the "Embed Scripts In Header" or "Embed Scripts In Footer" boxes. If you have turned on the GA tracking integration from the beginning of this article, these two boxes do not need your GA tracking script. 

Secondly, check out your products' Advanced Settings tab. There are three similar boxes where you could embed custom scripts. Your GA tracking script should not be included in any of these three boxes if you have turned on the GA tracking integration outlined in this article. While you may have other scripts included in these boxes, there is no need for your GA tracking script  to be included. 

Important Setting for External Thank You Pages

If you are sending customers to an external thank you page (aka not using SamCart's Order Summary Page), make sure you turn on the Fire Pixels Before Redirect toggle. This toggle is found in your Marketplace Settings, just below where you set up this integration. 

Fire Pixels Before Redirect must be toggled on if you are sending customers to your own thank you page. This toggle ensures that sales made from your final one click upsell are tracked before the user is redirected away from SamCart to your own thank you page. 

Frequently Asked Questions

Q: Can I install my Google Analytics tracking through the Tag Manager integration? 

A: Yes! You can use Google Tag Manager integration to track visitors and orders back to Google Analytics. There is no need to keep this Google Analytics integration turned on if you are installing Google Analytics through Tag Manager.  

Q: Will the purchase event account for coupons?

A: Yes! All purchase events will report back the correct dollar amount each customer was charged. So, any discounts applied from coupons will be reflected in the order value SamCart sends back to Google Analytics. 

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.