Set up Custom Conversion Events in Google Analytics for Google Ads

Last Updated on

Intro

Navigating the maze of digital marketing? One of the best ways to refine your Google Ads bidding strategy is by setting up custom conversion events in Google Analytics 4 (GA4). This guide will walk you through the steps to create, trigger, and import custom conversion events so that Google Ads can better optimize your ad spend based on actual conversion data.

Step 1: Create a conversion event in GA4

First of all, you need to create a custom conversion event in Google Analytics 4:

Screenshot of creating custom conversion event in Google Analytics 4
  1. Open Google Analytics
  2. Click "Admin" (a cog icon in the bottom left corner)
  3. Make sure you're on the "Admin" tab, not the "User" tab
  4. Select your account in the "Account" dropdown
  5. Select your property in the "Property" dropdown
  6. Click on the "Conversions" option with a flag icon in your property
  7. Make sure you see the "Conversion Events" page, URL will look like this: "https://analytics.google.com/analytics/web/?authuser=0#/a123456789p123456789/admin/attribution/conversions"
  8. Click "New conversion event" and follow the prompts

Step 2: Trigger the event

Now you need to add the event trigger to your website code (programming skills required):

window.gtag('event', 'YOUR_CONVERSION_NAME_FROM_GA', { optional: 'options' });

Make sure to replace YOUR_CONVERSION_NAME_FROM_GA with your "Conversion name" value of the custom conversion event you created in Google Analytics in the previous step.

Here's an example of how this can be implemented in React and TypeScript:

function sendGoogleAnalyticsEvent(
  name: string,
  options: Record<string, string | number | undefined> = {}
) {
  window.gtag('event', name, options);
}

export default function BuyNowButton() {
  function handleClick() {
    sendGoogleAnalyticsEvent('buy_now', {
      value: 100,
      currency: 'USD',
    });
    // TODO: redirect to payment page, etc.
  }

  return <button onClick=>Buy Now for 100 USD</button>;
}

Note, that you will need to make sure that window.gtag is defined by installing Google Tag Manager to your page, see how to Set up and install Tag Manager for details.

Also for added type-safety, you can install @types/gtag.js package from npm. If it doesn't work - you might have to add it into compilerOptions.types array of your tsconfig.json manually. See related question on StackOverflow.

Step 3: Import the event into Google Ads

Now you can import the new event into Google Ads Goals from Google Analytics:

Screenshot of creating new conversion action in Google Ads Screenshot of importing conversion event from Google Analytics 4 into Google Ads
  1. Go to Google Ads Conversions Summary. If the link doesn't work - select "Goals" on the left with a trophy icon, then expand the "Conversions" group and select "Summary"
  2. Click the "+ New conversion action" button
  3. On the "Start tracking conversions" page select "Import - Import data from Google Analytics or another source"
  4. It will ask you to "Select what you want to import", select "Google Analytics 4 properties"
  5. It will ask to select either "App (Firebase)" or "Web". Select "Web" for a website
  6. Click "Continue"
  7. On the "Select the conversion actions to import from a Google Analytics 4 property" page select the new custom event you created previously
  8. Click "Import and continue"
  9. Once done you'll see the "You've imported 1 web conversion action from Google Analytics (GA4)" page
  10. Click "Done"

Step 4: (optional) Adjust conversion settings

That's it, now you might want to change some conversion settings:

Summary

By following this step-by-step guide, you've successfully set up custom conversion events in Google Analytics 4 and imported them into Google Ads. This is more than just tracking; it's about optimizing your Google Ads bidding strategy based on real conversion events. Now Google Ads can make smarter decisions on how to allocate your budget for maximum ROI. Time to watch your strategy pay off!


Please, share (Tweet) this article if you found it helpful or entertaining!