Third-party analytics
- Domain verification
- Snippets
- Google Analytics
- Facebook
- Set up a pixel
- Add your pixel to Gumroad
- Go back to Facebook Events Manager
- Create a Campaign
- TikTok
- Setting up a TikTok pixel
- Tracking sales
To enable third-party analytics, go to the Third-party analytics settings tab.
Domain Verification
You can verify your Facebook domain by entering the meta tag containing the Facebook domain verification code generated from Facebook Business Manager.
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>
If ‘All Products’ is selected, that code will run for every successful sale you make. Select the product from the drop-down list if you want to track products individually.
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¤cy=USD&order=1&noscript=1
You can edit it to read:
https://www.example.com/tracking?value=$VALUE¤cy=$CURRENCY&order=$ORDER&noscript=1
This allows you to see the actual values of each sale for better cost analysis.
Google Analytics
Enter your Google Analytics Property ID into the Third-party analytics tab of your Gumroad Settings to start tracking pageviews and conversion events. See this Google help doc to find your Google Analytics Property ID.
Next, go to this Google help doc and follow the steps to create a conversion action in your Google Analytics account.
Once you have your Google Tag ID and conversion tracking ID, paste it into the `Snippets` code box of the Third-party analytics page. It should look like this:
<!-- Google tag (gtag.js) - Google Ads -->
<script async src="https://www.googletagmanager.com/gtag/js?id=TAG_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'TAG_ID');
</script>
<!-- Event snippet for Example conversion page -->
<script>
gtag('event', 'conversion', {'send_to': 'YOUR_CONVERSION_ID',
'value': $VALUE,
'currency': '$CURRENCY'
});
</script>
Note: Replace TAG_ID and YOUR_CONVERSION_ID with your actual values.
For each product, we currently send three events and three pageviews:
- A product page view
- An “I want this!” button click
- A purchase.
The three pageviews are for the same actions and are titled accordingly.
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 got 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.
A 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 Facebook help doc to learn how to set up a Meta Pixel (Formerly Facebook Pixel)
Step 2: Add your pixel to Gumroad
- Go to the Third-party analytics tab
- Paste Facebook ID in the Facebook Pixel box
Step 3: Go back to Facebook Events Manager
The Facebook Events Manager (now called 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 FB Pixel:
Gumroad Event | FB 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 Facebook Conversion Pixels at Facebook's dedicated page.
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 `Snippets` code section of the Third-party analytics page.
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>