Integrating Google Analytics

While you can use the template editor to insert your own GA script tag in the header, our native integration is designed to provide more accurate enhanced e-commerce data.

This is because conversion events are sent on the server side and are not affected by adblockers and other plugins blocking tracking scripts.

Once you’ve enabled the module, SPP will start sending page view and conversion events to GA.

Basic setup

Turn on ecommerce tracking to show SPP sales in your Analytics account. Go to Admin > View > Ecommerce Settings and click Enable Ecommerce.

Set up cross-domain tracking

When a customer navigates from your website (example.com) to your order form on SPP (clients.example.com or example.spp.io) Analytics will generate a new session and count them as a new user.

Enabling cross-domain tracking allows us to preserve customer’s sessions across domains and helps attribute actions on your website and purchases on SPP to the same visitor.

Option 1: If you’re using Tag Manager

To set up Tag Manager to measure user interactions across multiple domains open your Universal Analytics Tag and enable Cross-Domain Tracking as shown below:

Option 2: If you’re using gtag.js (default)

Modify the tracking code on your website by replacing this:

gtag('config', 'UA-XXXXXXX-Y');

With this:

gtag('config', 'UA-XXXXXXX-Y', {
    'linker': {
        'domains': [
            'clients.example.com',
            'example.spp.io'
        ]
    }
});

Replace UA-XXXXXXX with your own analytics ID, clients.example.com with your custom SPP domain if you have one, and example.spp.io with your default workspace url.

Create a conversion goal

To visualize the conversion funnel in Google Analytics you’ll need to set up a conversion goal.

  1. In Google Analytics go to Admin > Views > Goals
  2. Click + New Goal
  3. Choose Custom and click Continue
  4. Enter the following values and click Continue:
    1. Name: Complete purchase
    2. Type: Destination
  5. Enter the following values and click Save:
    1. Destination: (Regular Expression) /receipt/(.*)
    2. Funnel: On
      1. Step 1:
        1. Name: View orderform
        2. Screen/Page: /order/(.*)
        3. Required: Yes
      2. Step 2:
        1. Name: Submit orderform
        2. Screen/Page: /submit/(.*)

Form conversion tracking

You can create form-specific conversion goals by repeating the steps above and using your form ID instead of the wildcard selector (.*) in funnel steps.

For example, if your order form’s URL is https://clients.example.com/order/plans-orderform then your conversion goal’s destination is /receipt/(.*)?source=plans-orderform

Analytics FAQs

Why doesn’t my revenue match up with GA?

A common reason for revenue discrepancy is that SPP does not send all transactions to GA. Specifically, we ignore subscription payments and payments on manually issued invoices.

The reason for not logging subscription payments to Google Analytics is because these additional transactions would artificially inflate your e-commerce conversion rate.

For example, with one conversion out of 100 visitors your conversion rate would be 1%. If you logged 9 more subscription payments for that customer, GA would inaccurately report your conversion rate as 10%.

Similarly, any invoices you create manually typically fall outside of the self-serve funnel and so are not tracked as part of your e-commerce analytics.

How can I see the data that’s being sent to GA?

In your SPP workspace go to Settings > Logs and search for “Google Analytics”. You’ll see all the data we’ve sent to GA. Or, you can search for an invoice ID to find if it has been forwarded to GA.

How can I track additional events?

You’re welcome to add your own event tracking code to your portal’s templates, however note that you don’t need to include the main analytics.js code again as it is already loaded by our module.

You can place your event code in public/custom_scripts.html template in SPP. Here is some example code for tracking form submits.

Updated over a month ago

Thanks for your feedback 🙏

Was this helpful?