Track Google Ads purchase conversions
Track course purchases in Google Ads: Google tag in Site Body Code, conversion snippet with value, currency and transaction ID in Order Tracking Code.
Google Ads conversion tracking tells you which ads, keywords and campaigns lead to course purchases, and lets Google Ads bid for more buyers. On Learnyst you put the Google tag on every page and the purchase conversion code in Order Tracking Code, which runs only on the thank-you page after a purchase.
Before you start
- You need a Google Ads account.
- Google Ads & Meta Ads tracking and custom code are included in every Learnyst plan. See learnyst.com/pricing.
- Choose one method below for each purchase: the Google Ads tag (method 1), Google Tag Manager (method 2), or importing a GA4 key event (method 3). Using two methods for the same purchase records it in two conversion actions.
Recommended setup
- Create a website purchase conversion action in Google Ads.
- Paste the Google tag in Site Body Code (and in the website builder's Header Code).
- Paste the conversion event code in Order Tracking Code, with the order value, currency and transaction ID.
- Make a paid test purchase and check the conversion status in Google Ads.
Step 1: Create the conversion action in Google Ads
In Google Ads, click Goals, open Conversions > Summary, and create a new conversion action with Website as the source. Follow Google's guide for the current screens (Google: About conversion measurement; Google: Google Ads conversions). Choose these settings:
- Category: Purchase.
- Value: use a different value for each conversion, so Google Ads records the actual amount paid (Google: Track transaction-specific conversion values).
- Count: "Every conversion" counts every purchase after an ad interaction and is a good choice when every sale adds value (Google: About conversion counting options).
When Google Ads asks how to install the tag, choose to install it yourself. Google then shows two pieces of code: the Google tag (for every page) and an event snippet (for the purchase page).
Method 1: Add the Google Ads code in Learnyst
- In Learnyst, go to Grow > Marketing > Integrations > Code Snippets.
- Click Site Body Code, paste the Google tag at the end of the box, and click Save changes.
- Click Order Tracking Code, paste the event snippet in the format below, and click Save changes.
- If you use the website builder, also add the Google tag in Websites & Apps > Website > The all new Learnyst website builder > View Pages > More > Website Settings > Custom Code > Header Code, then publish your pages again.

Google tag for Site Body Code (your own tag has your AW- ID):
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-XXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-XXXXXXXXX');
</script>
Already have a Google tag for GA4 in Site Body Code? Don't paste a second gtag.js loader. Add only gtag('config', 'AW-XXXXXXXXX'); under the existing gtag('config', ...) line. Google's instructions say not to add more than one Google tag to a page (Google: Add a Google Analytics property (to a site that already has Analytics)).
Event snippet for Order Tracking Code. Copy the send_to value (your conversion ID and label) from the snippet Google Ads gives you, and keep the Learnyst variables as shown:
<script>
gtag('event', 'conversion', {
'send_to': 'AW-XXXXXXXXX/XXXXXXXXXXXXXXXXXXX',
'value': Number(productPrice),
'currency': 'INR',
'transaction_id': String(receiptNumber)
});
</script>

valueandcurrencypass the amount of each order. Use a three-letter ISO 4217 currency code in quotes, such as'INR'or'USD'(Google: Track transaction-specific conversion values).transaction_iduses the Learnyst receipt number, so the same order isn't counted twice. Google calls a transaction ID "the recommended option for purchases" (Google: Use a transaction ID to minimize duplicate conversions).- Order Tracking Code "runs on the thank you page when a purchase is completed". Free courses don't create an order, so they don't fire this conversion.
Method 2: Google Tag Manager
If you use GTM, don't paste the Google Ads code in Learnyst. Push the purchase into the data layer from Order Tracking Code (see Install Google Tag Manager), then in GTM add a Google Ads > Google Ads Conversion Tracking tag with your Conversion ID and Conversion Label, and set Conversion Value, Transaction ID and Currency Code from Data Layer Variables. Fire it on the purchase Custom Event trigger (Google: Google Ads conversions). If the value field is empty, GTM sends the value as 0.
Method 3: Import a GA4 key event
If GA4 already records purchase (see Set up Google Analytics 4), you can create a Google Ads conversion from it instead of adding Google Ads code. The event must be marked as a key event in GA4, your Google Ads and Google Analytics accounts must be linked, and auto-tagging must be on (Google: Create conversions from Google Analytics events in Google Ads; Google: Connect Google Ads to Google Analytics).
Enhanced conversions
Google Ads also offers enhanced conversions, which "can improve the accuracy of your conversion measurement". It hashes first-party data such as email addresses with SHA256 before sending it to Google (Google: About enhanced conversions). To set it up, follow Google's guide.
Test the conversion
- Open your school website in a private window with ad blockers off.
- Buy a paid product (for example a low-priced test product that you remove from sale afterwards). A free course won't fire the conversion.
- Use Tag Assistant on the address of your Learnyst site to check that the Google tag and the conversion fire (Google: Troubleshoot with Tag Assistant).
- In Google Ads, check the conversion action's status. Google says "An 'Unverified' or 'Inactive' status is normal for new tags"; it changes to "Active" after the first conversion or a successful test (Google: About conversion measurement).
Use cases
- Exam-prep coaching on Google Search: see which keywords bring paying students, not only clicks.
- Several price points: with the order value passed, Google Ads can optimise for revenue, not just the number of sales.
Common mistakes
- Event snippet in Site Body Code instead of Order Tracking Code, so a conversion is recorded on every page view.
- Two Google tags on the page, for example a second
gtag.jsloader for Google Ads next to the GA4 one. - Same purchase tracked twice: the Google Ads tag plus an imported GA4 key event, or plus a GTM tag, all used as conversion actions for the same purchase.
- Fixed value left in the event snippet (for example
'value': 1.0) instead ofproductPrice. - No transaction ID, so a refreshed thank-you page can count again.
- Testing with a free course, which doesn't create an order.
If it doesn't work
- Status stays Unverified or Inactive: make a paid test purchase, then check with Tag Assistant that the conversion fires on the thank-you page.
- Tag Assistant finds no Google tag: check Site Body Code was saved, and test the exact address of your Learnyst site. Add the tag to website builder pages if they're missing it.
- The conversion fires with value 0: check that the snippet uses
productPriceexactly as written (names are case-sensitive). - You can't add code: use method 3 and import the GA4 purchase key event.
What to do next
- Set up Google Analytics 4 on your Learnyst website
- Install Google Tag Manager and track sign-ups and purchases
- Add tracking code to your Learnyst website
- Tracking troubleshooting checklist
If you have questions, contact us at support@learnyst.com.