- Product Types
- Adding Products
- One Time Pricing
- Subscription Pricing
- Subscription Trials Setup
- Installment Pricing
- Donation / Pay What You Want
- Inventory Management
- Product Variants
- Variant Images
- Digital Downloads
- Change Product Availability
- Hide Product from Shop Page
- Template Customization
- Product Collections
- First-Time Payment Discounts
- Manage Product Access
- Payment Types
- Free Trials & Setup Fees
- Create Product With Free Trials
- Charge Set Up Fee on Trials
- Product List
- Product Pages
- Create Product Page in Elementor
- Custom Buy Links
- Product SEO
- Change Permalinks
- Custom Fields
- Adding Products
- Test Mode
- Make Test Payments
- Edit & Customize Form
- Change Form Template
- Delete SureCart Forms
- Custom Checkout Form
- Add New Checkout Form
- Checkout Form With Gutenberg
- Checkout Form in Elementor
- Custom Thank You Page
- Create Donation Form
- Customize Confirmation Popup
- Include Coupons in URLs
- Pre-Fill Checkout Fields
- Change Checkout Texts
- Password Field in Checkout
- Default Country Code
- Add Terms to Checkout
- Conditional Block Checkouts
- Remove Coupon Field
- Hide Quantity Option
- Disable Quantity Editing
- Disable Item Removal
- Country Specific Purchases
- Fix View Order Button
- Fix Express Payment Buttons
- Fix PayPal Test Connection
- Fix PayPal Test Connection
- Fix Sign-In Loop
- Fix Order Confirmation Redirect
- Fix Divi Bullet Point Issue
- Fix Customer Dashboard
- Fix JSON Response Error
- Failed Payment Behavior
- Fix Stripe Zip Code Error
- Fix "Product Can’t Be Blank"
- Troubleshooting Guide
- PayPal IPN Warning Emails
- Caching Configuration for SureCart
- Why iDEAL Might Not Appear in Your CheckoutÂ
General Support Guide for Integrating Analytics with Any Solution
Many SureCart users want to integrate their store analytics with platforms beyond Google Analytics, such as Facebook Pixel, Fathom, or custom analytics solutions. SureCart provides flexibility for tracking a variety of events and data points to help store owners analyze their business performance across various platforms.
This guide will outline the general steps for integrating SureCart with any analytics platform.
Understanding the Basics
SureCart automatically tracks several key events related to customer behavior in your store. These include:
- Add to Cart
- Checkout Initiated
- Purchase Completed
- Subscription Started
While SureCart offers built-in integrations for popular platforms like Google Analytics and Facebook Pixel, you can integrate other solutions by leveraging SureCart’s ability to fire custom JavaScript events or send data to third-party platforms via webhooks or API connections.
General Steps for Analytics Integration
To integrate SureCart with any analytics solution, follow these general steps:
Step 1: Identify the Key Events to Track
Decide which events are critical to your store. Some common events include:
- View Product
- Add to Cart
- Begin Checkout
- Purchase Completed
- Subscription Start
SureCart fires these events automatically, and you can listen to them or customize the events you want to track.
Here is a table for all the events that can be tracked in SureCart:
Event | Event Name | Description |
scAddedToCart | Added to Cart | Triggered when a customer adds an item to their shopping cart. |
scRemovedFromCart | Removed from Cart | Triggered when a customer removes an item from their shopping cart. |
scViewedCart | Viewed Cart | Triggered when a customer views their shopping cart. |
scProductViewed | Product Viewed | Triggered when a customer views a product page. |
scCheckoutInitiated | Checkout Initiated | Triggered when a customer begins the checkout process. |
scCheckoutCompleted | Checkout Completed | Triggered when a customer successfully completes the checkout process and finalizes their purchase. |
scShippingInfoAdded | Shipping Info Added | Triggered when a customer adds or updates their shipping information during checkout. |
scPaymentInfoAdded | Payment Info Added | Triggered when a customer adds or updates their payment information during checkout. |
scTrialStarted | Trial Started | Triggered when a customer starts a free trial for a subscription-based product. |
scSubscriptionStarted | Subscription Started | Triggered when a customer starts a paid subscription for a product. |
Step 2: Set Up Your Analytics Platform
Each analytics platform will have a method for tracking events or actions on your site. For example:
- Google Analytics: Through Google Tag Manager (GTM)
- Facebook Pixel: By adding event listeners for user actions.
- Fathom: Using their API to track specific user interactions.
Make sure your analytics platform is properly installed on your site, typically by embedding a tracking code snippet in the header of your WordPress site.
Step 3: Listen for SureCart Events
SureCart triggers several events when actions are performed by customers. You can use JavaScript event listeners to capture these events and send data to your preferred analytics platform.
For example, the following event listener captures when the checkout process is completed:
Javascript:
window.addEventListener('scCheckoutCompleted', function(e) {
const checkoutData = e.detail; // Checkout data is available here.
// Use the data to send to your analytics platform
});
Step 4: Send the Data to Your Analytics Platform
Once you capture the event, the next step is to send the relevant data to your analytics platform. This can vary depending on the platform you’re using:
- For Facebook Pixel: You can use Facebook’s ‘fbq’ function to log the event:
Javascript:
fbq('track', 'Purchase', {
value: checkoutData.total,
currency: checkoutData.currency
});
- For Fathom: Use the Fathom API to log the event:
Javascript:
fathom.trackGoal('YOUR_GOAL_ID', checkoutData.total);
- For custom analytics solutions: You may need to send an HTTP request or use their provided JavaScript API to send the data.
Step 5: Test and Verify
After setting up the event listeners and data-sending functions, perform actions on your SureCart store (like adding items to the cart or completing a purchase). Use your analytics platform’s dashboard or logs to verify that the events are tracked correctly.
Additional Tools for Integration
If you need more flexibility, consider the following options:
- Webhooks: SureCart supports sending data via webhooks, allowing you to push event data to a variety of endpoints. You can configure webhooks in SureCart’s settings to notify your analytics solution when certain actions occur.
- API Integrations: If your analytics platform provides an API, you can integrate it directly with SureCart using custom code. Make API calls from your store to log events and track actions.
Example: Custom JavaScript for Event Tracking
Here is a practical example of how to integrate a custom analytics platform by listening for SureCart events and sending data:
Javascript:
// Listening for the checkout completed event
window.addEventListener('scCheckoutCompleted', function(e) {
const checkoutData = e.detail;
// Example of sending data to a custom analytics platform
fetch('https://analytics.yourplatform.com/track', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
event: 'Checkout Completed',
total: checkoutData.total,
currency: checkoutData.currency
}),
}).then(response => {
console.log('Event tracked successfully:', response);
}).catch(error => {
console.error('Error tracking event:', error);
});
});
In this example, we capture the ‘scCheckoutCompleted’ event and send a POST request to a custom analytics platform with relevant data like the total purchase amount and currency.
SureCart makes it easy to integrate with any analytics platform. By leveraging custom JavaScript and event listeners, you can capture essential user interactions and send them to your analytics solution of choice.
For more detailed tracking or custom requirements, consider working with a developer or using available SureCart webhooks to automate event tracking.
If you need help with specific integrations, check out SureCart’s Developer Documentation or consult the community for support.
We don't respond to the article feedback, we use it to improve our support content.