gometrify Logogometrify
Free ToolsGuidesPricing
← Back to All Guides

How to Track Conversions and Revenue (Tracking Script Setup)

By gometrify Team•July 12, 2026•
tracking scriptconversion trackingrevenue attributionshopifywoocommercestripepaypal

Tracking click volume tells you how much traffic you are getting. It does not tell you if that traffic is converting. If you want to know which creator, ad, or link is driving actual revenue, you need conversion tracking.

By adding a lightweight script to your checkout thank-you page or signup confirmation page, gometrify attributes conversion values and events directly back to the click source in real time.


How it works

  1. Click: A visitor clicks one of your short links.
  2. Redirect: gometrify appends a unique click ID (gmt_cid) to the destination URL.
  3. Session: The initialization script on your site caches the click ID.
  4. Conversion: The checkout page script reads the click ID and sends the purchase total and currency to the gometrify API.

1. Load the initialization script

You need to load the global initialization script on every page of your site. This script catches the gmt_cid query parameter when visitors arrive and keeps track of it.

Paste this snippet inside the <head> tag of your website layout:

<script src="https://www.gometrify.com/init.js"></script>

2. Install the conversion script

Choose your platform below and copy the script to your checkout success or thank-you page.

Shopify

  1. In Shopify Admin, go to Settings → Checkout.
  2. Scroll to the Order status page section.
  3. Paste this snippet in the Additional scripts box:
<script
  src="https://www.gometrify.com/pixel.js"
  data-revenue="{{ checkout.total_price | money_without_currency }}"
  data-currency="{{ checkout.currency }}"
  data-event="PURCHASE">
</script>

WooCommerce

  1. In your WordPress dashboard, open Appearance → Theme File Editor.
  2. Edit your active theme's woocommerce/thankyou.php template.
  3. Paste this script before the closing </body> tag:
<script
  src="https://www.gometrify.com/pixel.js"
  data-revenue="<?php echo $order->get_total(); ?>"
  data-currency="<?php echo $order->get_currency(); ?>"
  data-event="PURCHASE">
</script>

Webflow

  1. In Webflow project settings, add the head script (init.js) to the Head Code section.
  2. In the Webflow designer, open the Order Confirmation page settings.
  3. Paste this script in the Before tag custom code box:
<script
  src="https://www.gometrify.com/pixel.js"
  data-event="PURCHASE">
</script>

Stripe (Payment Links & Checkout)

Stripe does not allow custom JavaScript on their hosted checkout pages. You must redirect users to a custom success page on your domain to track conversions.

  1. In your Stripe Dashboard, edit your Payment Link or Checkout settings.
  2. Under "After payment", select Don't show confirmation page and set it to redirect to your website's custom thank-you page.
  3. On your custom thank-you page, paste this script (replace the value with your Monthly Recurring Revenue (MRR) or subscription price):
<script
  src="https://www.gometrify.com/pixel.js"
  data-revenue="YOUR_SUBSCRIPTION_PRICE"
  data-currency="USD"
  data-event="SUBSCRIBE">
</script>

PayPal

Like Stripe, PayPal hosted buttons require a redirect for custom tracking.

  1. In your PayPal button settings, configure the Auto-Return URL to point to a custom success page on your website.
  2. Paste this script on that return page to fire the subscription conversion:
<script
  src="https://www.gometrify.com/pixel.js"
  data-revenue="YOUR_SUBSCRIPTION_PRICE"
  data-currency="USD"
  data-event="SUBSCRIBE">
</script>

Custom HTML / JS Checkout

For custom setups, paste this script on your order confirmation page. Replace the placeholder values with your backend's order totals:

<script
  src="https://www.gometrify.com/pixel.js"
  data-revenue="YOUR_ORDER_TOTAL"
  data-currency="USD"
  data-event="PURCHASE">
</script>

If you are tracking signups or leads (no purchase value), set data-event to "SIGNUP" or "LEAD" and omit the revenue parameter:

<script
  src="https://www.gometrify.com/pixel.js"
  data-event="SIGNUP">
</script>

How to test the setup

To make sure conversions attribute correctly before driving live traffic:

  1. Create a test link in your gometrify workspace.
  2. Click the link and check that ?gmt_cid=... is appended to the URL in your browser.
  3. Complete a test purchase or registration on your site.
  4. Check your campaign workspace dashboard. Under the corresponding node, you should see 1 Conversion and the exact revenue amount you spent in the test.

Plan requirements

Conversion and revenue tracking features are available on the Pro ($29/mo) and Business ($99/mo) plans. You can upgrade at any time from your dashboard or via the Pricing page.

g

gometrify Team

Marketing attribution experts and builders of gometrify. We write about advanced analytics, SEO, and ad tracking.

Related Guides

Shopify Profit Margins: How to Stop Bleeding Money on Hidden Fees

Are your Shopify sales growing while net profits shrink? Learn how transaction fees, app subscriptions, shipping margin erosion, and return costs eat into your net profit margin.

Why Your Facebook Ads Data Is Wrong (And How to Get the Real Numbers)

Learn how to bypass the iOS 14 update limitations and track true Facebook Ad ROI using first-party tracking.

Answer Engine Optimization (AEO): The Framework Replacing Traditional SEO

Search is no longer just blue links. AI engines answer questions directly and cite sources. AEO is the practice of optimizing your content to be the source that gets cited. Here is how it works and what to actually change.

Table of Contents

  • How it works
  • 1. Load the initialization script
  • 2. Install the conversion script
  • How to test the setup
  • Plan requirements
Track every click.

Find out exactly where your conversions come from.

Start Free