Third-party analytics

Google Analytics

Google ended support for Universal Analytics on July 1, 2023, and replaced it with Google Analytics 4. Please use the GA4 property to avoid any data or functionality loss.

Watch this Google Analytics setup video by our engineer, Connor:

The easiest way to set up Google Analytics on your Gumroad account is to paste your GA-4 measurement ID  into the Google Analytics Property ID field on the Third-party analytics Settings page. Your GA4 measurement ID will look like this: G-P2AB123Z3D

Here’s how to create a new GA4 property. Please provide your Gumroad profile URL while you are setting up your data stream, which you can find in the username section of the Profile settings.

For each product, we currently send three events and three pageviews:

  1. view_item: A product page view
  2. add_to_cart: An “I want this!” button click
  3. purchase: A purchase. 

The three pageviews are for the same actions and are titled accordingly.

Once the setup is complete, the data usually appears quickly on GA’s Realtime dashboard even if the "Data Streams" table suggests that no data has been received in the last 48 hours.

You’ll see the Google Analytics conversion events in the Events tab of the Reports page.

Product events are listed under an event category named by that product’s shortlink. Choose “Event Action” as the Primary Dimension to see more details about how far customers progressed in a given product’s purchase flow.

For purchase events, we also pass in the 'Value' of the event (the sale price) in the unit of the product's currency (for example, '100' for a $1 sale).

Similarly, you can see how your customers move through the Gumroad purchase flow and how many drop off at each step by following the instructions in this Google help doc.

Please note you may see discrepancies between Gumroad and Google Analytics. In every case, you should trust Gumroad's numbers over Google's. Google Analytics is a piece of JavaScript that sends events from Gumroad to Google. When these scripts don't run (a user's privacy preferences may turn off external loading, for example), the purchase data never makes its way to Google.

Cross-domain tracking

You can analyze and track how users are moving from your website to your Gumroad product and eventually to a successful purchase. 

Follow these steps by Google to add your website’s domain to your data stream. Once done, you will be able to see how your customers move through your site, onto Gumroad, and the actions they take there.

Domain verification for Meta (Facebook)

You can verify your Facebook domain by entering the meta tag containing the Facebook domain verification code generated from Facebook Business Manager.

Meta Pixel

A Meta (Facebook) pixel provides key data to optimize your ads on Facebook. 

Gumroad doesn’t support FB Conversion API (server side). One possible way is to do it through our Gumroad Ping. With Gumroad Ping, you'll receive the product_permalink (among other payloads) to your specified endpoint when you make a sale. You can handle that permalink from your backend and send the appropriate FB Conversion API. The same product_permalink is sent client-side as part of FB Pixel's content_ids.

For a full in-depth view of how to use the Facebook Pixel, check out this interview with Gumroad creator Jimmy Xia:

Step 1: Set up a pixel

  • Follow this Meta help doc to learn how to set up a Meta pixel (formerly Facebook pixel)

Step 2: Add your pixel to Gumroad

Step 3: Go back to Meta Events Manager

The Meta Events Manager provides valuable information such as who's viewing your products, who are initiating a checkout, and who's making purchases. 

The most important value is the Purchase event. With this event, you can create a Lookalike Audience. Lookalike audiences simulate people closest to those who have already purchased the product. 

Step 4: Create a campaign

You can create campaigns and goals based on where you're as a business, whether you've been around for a long time and are looking to reach new audiences or are just starting out. 

Get started with the Meta Ads Manager to create ad campaigns around your Gumroad products.

Here's a table to show how we map Gumroad events with Meta Pixel:

Gumroad Event Meta Pixel
viewed ViewContent
iwantthis InitiateCheckout
purchased Purchase

The status of your Conversion ID will remain Unverified until someone clicks your product link on Facebook and buys your product. If you run a test purchase of the product through Facebook, this will verify and activate the pixel.

Learn more about Meta Pixel here.

Snippets

You can add snippets provided by services like Google, Facebook, Twitter, and others to track conversions, set up retargeting, and measure ad performance. This code will be triggered based on your Location selection - on a product page, after a purchase is completed, or both.

These third-party services will provide you with a block of code to insert between <head> and </head> on your website. Copy that block of code and paste it into the code box. Additionally, you can include your own custom JavaScript in a snippet. For example, the following snippet will log “Hello Gumroad!” to the browser console:

<script>console.log(“Hello Gumroad!”);</script>

The ‘Location’ field controls where the snippet runs. If you select ‘Product page’, the snippet will run on the product page. If you select ‘Receipt’, it will run after a successful purchase. If you select ‘All pages’, it will run on the product page, and after a successful purchase of the product.

The 'Products' field determines the specific products to which the snippet is applicable. If ‘All Products’ is selected, the snippet will apply to all of your products.

Some services allow you to include the sale's value, currency, and/or order number. We can enter those values for you if you add $VALUE, $CURRENCY, and $ORDER in place of the set price, currency, and order number, respectively. 

For example, if the URL reads:

https://www.example.com/tracking?value=0.0&currency=USD&order=1&noscript=1

You can edit it to read:

https://www.example.com/tracking?value=$VALUE&currency=$CURRENCY&order=$ORDER&noscript=1

This allows you to see the actual values of each sale for better cost analysis.

You can use our snippets feature to track Google Ads conversions. Check out this Google Ads conversion tracking walkthrough video by our engineer, Connor:

Go to this Google help doc and follow the steps to create a conversion action in your Google Analytics account. 

Create a new snippet, set the “Location” to “Receipt”, choose the product you’re advertising, and paste this script into the Snippets code box:

<script async src="https://www.googletagmanager.com/gtag/js?id=YOUR_CONVERSION_ID"></script>

<script>

window.dataLayer = window.dataLayer || [];

function gtag(){dataLayer.push(arguments);}

gtag('js', new Date());

gtag('config', 'YOUR_CONVERSION_ID');

</script>


<script>

gtag('event', 'conversion', {

'send_to': 'YOUR_CONVERSION_ID/YOUR_CONVERSION_LABEL',

'value': $VALUE,

'currency': '$CURRENCY',

'transaction_id': '$ORDER',

});

</script>

Note: Replace YOUR_CONVERSION_ID and YOUR_CONVERSION_LABEL with your actual values. YOUR_CONVERSION_ID must be prefixed with "AW-" for conversion events to work correctly.

All Gumroad snippets run from https://gumroad-analytics.com rather than https://gumroad.com, so if you're using the new web-based Google Tag Assistant for testing rather than the legacy Chrome extension, you'll miss any Google Tag events triggered by Gumroad snippets unless you're listening to events on https://gumroad-analytics.com.

If you want a custom conversion event to show up in both Google Analytics and Google Ads, you should set it up in Google Analytics (see here) and then link it to Google Ads (see here).

Twitter

After creating a campaign, go to  "Events Manager" and get the id from "Universal Website Tag". If it doesn't appear, you can click "Add event source" to create it.

Add the following tag in the code box under “Add snippet” (note: replace ’YOUR TWITTER ID’ with your actual ID from Twitter):

<img height="1" width="1" style="display:none;" src="https://analytics.twitter.com/i/adsct?txn_id=’YOUR TWITTER ID’&p_id=Twitter"/>

You can learn more about Twitter Conversion tracking here.

TikTok

Setting up the TikTok pixel:

You must set up your TikTok pixel first to begin tracking sales. You can receive your pixel by following the instructions explained here.

After you’ve received the pixel, paste it into the code box.

Tracking sales:

To track sales via the TikTok pixel, set up a standard "Place an Order" event as detailed here. You can add the following code to the third-party analytics snippet section to track this event with the order value:

ttq.track("PlaceAnOrder", { 

value: '$VALUE',

currency: '$CURRENCY',

});   

The pixel and your “Place an Order” event combined should look like the snippet below:

<script>

!function (w, d, t) {

w.TiktokAnalyticsObject=t;var ttq=w[t]=w[t]||[];ttq.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie"],ttq.setAndDefer=function(t,e){t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}};for(var i=0;i<ttq.methods.length;i++)ttq.setAndDefer(ttq,ttq.methods[i]);ttq.instance=function(t){for(var e=ttq._i[t]||[],n=0;n<ttq.methods.length;n++)ttq.setAndDefer(e,ttq.methods[n]);return e},ttq.load=function(e,n){var i="https://analytics.tiktok.com/i18n/pixel/events.js";ttq._i=ttq._i||{},ttq._i[e]=[],ttq._i[e]._u=i,ttq._t=ttq._t||{},ttq._t[e]=+new Date,ttq._o=ttq._o||{},ttq._o[e]=n||{};var o=document.createElement("script");o.type="text/javascript",o.async=!0,o.src=i+"?sdkid="+e+"&lib="+t;var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(o,a)};


ttq.load('CFH83AJC77UUUGLE2TJG');

ttq.page();

}(window, document, 'ttq');


ttq.track("PlaceAnOrder", { 

value: '$VALUE',

currency: '$CURRENCY',

});    

</script>

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us