Google Analytics

How to Track Affiliate Sales in Google Analytics?

Integrating with Google Analytics enables you to push sales generated by users to your Google Analytics account. This provides insights into your channel performance, traffic sources, landing pages, and content.

With Strackr, there's no need to cloak your URLs or connect to an external API to modify your links, ensuring fast page loads for your visitors. We utilize subids/customs to relay the anonymous Client ID to the transaction. Subsequently, Strackr fetches the transactions using this Client ID and pushes them to your Google Analytics account.

This guide will walk you through integrating with two easy steps:

  1. Enable the Ecommerce feature in Google Analytics.
  2. Install our JavaScript snippet (roughly 3ko gzipped) or do it manually.

Enabling Ecommerce in Google Analytics

To enhance sales attribution accuracy, extend the session duration to the maximum of 7 hours and 55 minutes.

Navigate to Admin → Property → Data Streams, and select your Data Stream. On this page, click on More Tagging Settings:

Then, adjust the session timeout:

Select the maximum value and save your changes:

Your Google Analytics 4 account is now set up.

Strackr Integration

1. Depending on the version you are using, you'll need either your Measurement ID for Google Analytics 4.

  • Go to the Admin page, in the Property column, select Data Streams, and click on your web data stream. Your “G-” Measurement ID appears in the top-right corner, e.g., G-1111111111.

Refer to the Google documentation for more details.

Now, in Strackr, go to the Integrations section, click on the Google Analytics tab, and select Add an account. Enter the tracking ID or measurement ID you retrieved from Google Analytics:

Add Google account

Optionally, you can specify a URL that will be used as the HostName in your Google Analytics reports.

Once added, you'll receive your Strackr Tracking ID (STID), which is a 5-character ID, e.g., gSfhP.

2. On the same page, click on the JavaScript snippet icon on the right to view the Javascript snippet. Paste this after the Google Analytics tag on each page where you want to track sales:

Javascript snippet

That's it! Strackr will handle sending transactions to Google Analytics, enabling you to track performance metrics such as landing pages, channels, sources, mediums, campaigns, devices, demographics, and locations.

Additional Information

  • If you utilize subids/customs in your URLs, our script will append an empty parameter without replacing your existing subids.
  • If an adblocker blocks Google Analytics, you might not see the transaction in Google Analytics, or only the transaction without the related site navigation.
  • Safari might block third-party Javascript from accessing the Google Analytics Javascript API. In this case, we recommend proxying our script. For more details, visit this page.

Next Steps

    Get started for free

    30 days free trial, no credit card required. Connect to your networks within minutes — and cancel anytime.

    Try for free

    Try the live demo

    Not quite ready to sign up? Take a test drive of the Strackr dashboard in our interactive live demo.

    See the live demo

    Still have questions?

    If there’s anything else you want to know about Strackr, contact us and we’ll be happy to fill you in.

    Contact us