Illustrated banner reading “PostHog integration with Google” with PostHog and Google logos and a green frog.

PostHog Google Ads Integration: Conversion Tracking

Today, I want to explain how to integrate your PostHog conversion tracking with Google Ads. The objective is to achieve…

Today, I want to explain how to integrate your PostHog conversion tracking with Google Ads. The objective is to achieve the highest possible event match quality by leveraging all available customer data stored in PostHog, replicating the same level of precision and completeness we implemented for other platforms.

If you’re looking for PostHog integrations with other advertising platforms, see:

If you want a custom implementation without the technical work, contact us through the ‘Contact Us’ button in the sidebar and we’ll help architect and deploy a tracking solution tailored to your business needs.

Quick answer

To send PostHog conversion events to Google Ads, configure PostHog’s ‘Google Ads Conversions’ destination, connect your Google Ads account, and add one mapping for each conversion action. Filter events to people with a valid GCLID, or—if enhanced conversions is enabled—send hashed customer information as well, then test the destination before going live.

Requirements

We assume you already have PostHog setup and tracking the events you intend to send to Google Ads. If not, go to installation guides in our PostHog articles, OR reach out to us to schedule a free consultation call.

Start Here

PostHog Destinations [PostHog CDP destinations guide] is the feature that streams your data to external systems in real time. The ‘Google Ads Conversions’ destination [Google Ads destination documentation] is a default PostHog integration that we use to send your conversion events directly to Google Ads.

To start, navigate to ‘Data management’ and then to ‘Destinations’. Here, you can find your required destination by selecting ‘Google Ads Conversions’.

Unlike the Meta setup where teams often create separate destinations per event, Google Ads can usually be handled in one destination by adding multiple mappings; one per conversion action.

By default, Google only accepts conversions with a valid GCLID. Therefore you can set a global filter to only send events where person’s latest gclid is present. If you have enhanced conversions enabled, Google allows you to send events without a GCLID, but only if you send hashed customer info as well. In that scenario, your filter will be a SQL like this:

person.properties.gclid IS NOT NULL
OR person.properties.email IS NOT NULL // change email to any field you actually have & send

PostHog Google Ads Conversions destination showing an active setup with a latest-gclid filter and matching-events chart.

Connect google ads account

Now you should connect your google ads account at this step. then fill the Customer ID field with the ID that is available in your google ads account.

Google account menu with a Google Ads testing account selected.
PostHog Google Ads account settings showing a connected Google Ads account and Customer ID field.

Mappings

Here, you configure which PostHog events will trigger which Google conversion events. PostHog provides a default mapping template that can be used as a base for any event you want to send. You can edit or duplicate this mapping and modify both the name and the corresponding PostHog event to match your intended conversion action.

PostHog Google Ads Conversions mapping showing Product Added mapped to Add To Cart with conversion fields.

Match events and actions: Your PostHog event. If there are multiple events, define them as an action first to make it easier to select here.

Conversion action: The Google Ads conversion action that should receive this event. You need to have them created at least 6hours in advance. (Yeah, this is a ridiculous Google Ads limitation.)

Google Click ID (gclid): Self-explanatory. Use the latest GCLID rather than initial, for the best attribution results.

In the default template, you’ll typically see PostHog prefills this field with ‘{person.properties.gclid ?? person.properties.$initial_gclid}’, but you can adjust it if your gclid is stored under a different property name.

Conversion Date Time: This field represents the exact date and time when the conversion occurred. PostHog automatically formats it correctly and prefills it with {formatDateTime(toDateTime(event.timestamp), ‘%Y-%m-%d %H:%i:%S’)}+00:00, which matches Google’s required timestamp format.

Optional But Essential

From this point onward, all fields are optional. However, we will focus only on the ones we consider essential to send to Google Ads in order to achieve the highest possible event match quality.

Conversion value: This represents the revenue generated from the conversion. Map it to the appropriate property in PostHog, such as ‘{event.properties.price}’ or ‘{event.properties.total_amount}’, depending on your implementation.

Currency code: This field defines the ISO currency code (e.g., USD, EUR) for the conversion value. Map it to the appropriate PostHog property, typically ‘{event.properties.currency}’.

Order ID: This is the unique transaction identifier for the conversion. It must be unique per conversion action to avoid duplication. Map it to a transaction-level property in PostHog, such as {event.properties.order_id} or {event.properties.transaction_id}.

Add IP, Name, & Email Fields

The remaining fields are not visible on the default page, so you must create them by clicking on ‘Add input variable.’ This button only appears after you open the ‘Edit source’ section below.

PostHog Google Ads Conversions fields for IP address and hashed last name, first name, and email.

Once you click ‘Add input variable,’ a new raw field will appear with a generic name. You should then edit both the ‘Display label’ and the ‘Input variable name’ to match the exact field you want to send. You can access these editable settings by clicking the gear icon on the right side of the field.

For example, to create a field for IP Address, set the “Display label” to “IP Address” and the “Input variable name” to the property where your IP address is stored, such as {event.properties.$ip}.

IP Address: Typically mapped from {event.properties.$ip}. Ensure IP capture is enabled and that you are sending the end user’s IP address rather than your server’s IP. In third-party integrations (e.g., RevenueCat), the IP may instead be available under ‘{event.properties.subscriber_attributes.$ip}’.

Quick note: Email address, first name, and last name must be normalized (lowercased) and hashed with SHA-256 before being sent, following the same process used for Meta.

em: Email address. If you set this property you can catch it with this {sha256Hex(lower(person.properties.email))}

fn: First name. Same as above, it will be {sha256Hex(lower(person.properties.first_name))}

ln: Last name. Same as above, it will be {sha256Hex(lower(person.properties.last_name))}

Manage Source Code

To add custom fields and fully align the destination with your data structure, you’ll need to edit the source code of the destination template. This allows you to define additional input variables, adjust mappings, and ensure the payload matches your specific implementation.

Below is an example of the source code we use in one of our projects that follows the configuration outlined above.

Test before you Start

Before going live, test the configuration to confirm that conversions are being sent correctly and no errors appear in the destination logs.

Frequently asked questions

What does the PostHog–Google Ads integration do?

PostHog Destinations stream data to external systems in real time, and the Google Ads Conversions destination is the default PostHog integration used to send conversion events directly to Google Ads.

Do I need a separate destination for every conversion event?

Usually not: Google Ads can be handled in one destination by adding multiple mappings, with one mapping per conversion action.

When should a PostHog event pass the Google Ads filter?

By default, send only events where the person’s latest GCLID is present because Google accepts conversions with a valid GCLID. If enhanced conversions are enabled, events without a GCLID can be sent only when hashed customer information is included.

How do I map a PostHog event to a Google conversion action?

Use a mapping to connect the PostHog event that triggers to the Google conversion action that should receive it. You can edit or duplicate PostHog’s default mapping and change its name and event to match your intended conversion action.

How far in advance should I create the Google conversion action?

Create the Google Ads conversion action at least six hours in advance.

Which click ID and timestamp should I send?

Use the latest GCLID rather than the initial one for better attribution, and set Conversion Date Time to the exact time the conversion occurred. PostHog automatically formats that field to Google’s required timestamp format.

Which optional fields help measure conversion value?

Map Conversion value to the revenue property for the conversion, use the matching ISO currency code, and provide an order ID that is unique per conversion action to avoid duplication.

How should I prepare identity and IP fields?

Lowercase and SHA-256 hash email, first name, and last name before sending them. For IP Address, ensure IP capture is enabled and send the end user’s IP rather than the server’s IP.

When should I edit the destination source code?

Edit the destination template’s source code when you need custom fields or must align the payload with your data structure; it is also where you define additional input variables and adjust mappings.