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:
- Open Google Analytics
- Click "Admin" (a cog icon in the bottom left corner)
- Make sure you're on the "Admin" tab, not the "User" tab
- Select your account in the "Account" dropdown
- Select your property in the "Property" dropdown
- Click on the "Conversions" option with a flag icon in your property
- 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"
- 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:
- 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"
- Click the "+ New conversion action" button
- On the "Start tracking conversions" page select "Import - Import data from Google Analytics or another source"
- It will ask you to "Select what you want to import", select "Google Analytics 4 properties"
- It will ask to select either "App (Firebase)" or "Web". Select "Web" for a website
- Click "Continue"
- On the "Select the conversion actions to import from a Google Analytics 4 property" page select the new custom event you created previously
- Click "Import and continue"
- Once done you'll see the "You've imported 1 web conversion action from Google Analytics (GA4)" page
- Click "Done"
Step 4: (optional) Adjust conversion settings
That's it, now you might want to change some conversion settings:
- "Action optimization" - change "Primary" to use it to optimize bidding, or "Secondary" otherwise
- "Value" - this won't directly affect bidding optimization, but can make ROI reports more accurate
- "Conversion Name" - you can change the name of the conversion, however, I would suggest keeping it the same as "GA4 event" so it's easier to navigate
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!