The GA4 connector gives you sessions, engaged sessions, key events, orders and revenue for each date, session campaign and session source / medium, but no cost, impressions or clicks: Google Analytics does not measure ad delivery, so those columns stay empty on GA4 rows. To see sessions next to spend, you join the GA4 rows to an ad platform's rows on the date and a campaign key. The best key is a campaign ID that both sides share, which GA4 has for auto-tagged Google Ads traffic and for any link tagged with utm_id set to the platform's campaign ID. Without one, join on campaign name, and remember that UTM values are case-sensitive. Once joined, the clicks and sessions on a row will not be equal, and they are not meant to be.
What the GA4 rows hold
A GA4 pipeline asks the Data API for four dimensions, date, sessionCampaignId, sessionCampaignName and sessionSourceMedium, and writes one row per date, campaign and source / medium. The row's network is ga4. Where the columns land:
| Column | What it holds on a GA4 row |
|---|---|
campaign_id |
The session campaign ID, or the campaign name when GA4 reports no ID or (not set) |
campaign_name |
The session campaign name |
adgroup_id, adgroup_name |
Both hold the session source / medium, such as google / cpc |
ad_id |
Empty |
cost, impressions, clicks, conversions, conversion_value |
Empty |
extra.sessions and the other extras |
GA4's own figures |
The full list of extras and their meanings is on the GA4 connector page. Two of them, extra.total_users and extra.new_users, must not be summed across days or campaigns; sessions, orders and revenue can be. Revenue is in the property's currency, which may not be the ad account's currency that cost uses.
Choose the join key
Google's Data API reference describes the session campaign ID as covering Google Ads campaigns, manual campaigns and other campaigns. Its separate manual campaign ID dimension is filled from the utm_id URL parameter. That gives you two ways to get a real ID onto your GA4 rows:
- Google Ads with auto-tagging. The session campaign ID is the Google Ads campaign ID, the same value etlmcp's Google Ads connector writes to
campaign_id. A join on date andcampaign_idworks without extra tagging. - Every other platform. Put the platform's own campaign ID into
utm_idwith its URL macro, so the GA4campaign_idmatches thecampaign_idthat the other platform's connector writes, such as Meta's campaign ID. Google's URL builder help says to use the same IDs you use when uploading campaign data. The macros differ by platform: see Google Ads ValueTrack for UTMs and the UTM parameter reference.
If your links carry only utm_campaign, the GA4 row has no ID, and etlmcp keys it on the campaign name. Then join on name, with two risks: a renamed campaign splits its history (see renamed campaigns), and case matters.
Case-sensitive values
Google's URL builder help states that parameter values are case-sensitive: utm_source=google and utm_source=Google are different sources, and the same goes for campaign names. In GA4 they become separate rows. In PostgreSQL, a text comparison with = is case-sensitive too, so Spring_Sale in Meta and spring_sale in a UTM do not match. Google recommends a strict naming convention in lowercase. Until your tagging follows one, compare names through lower(), which converts text to lower case by the database locale's rules, and group GA4 rows by the lowered name before you join.
A name-based join in PostgreSQL
When both pipelines load into one PostgreSQL table named marketing, this query sums each side to date and lowered campaign name, then sets them side by side. Extra columns keep their dotted names in PostgreSQL, so they are written in double quotes. If you have IDs on both sides, replace lower(campaign_name) with campaign_id in both blocks.
WITH spend AS (
SELECT date, network, lower(campaign_name) AS campaign_key,
sum(cost) AS cost, sum(clicks) AS clicks, max(currency) AS currency
FROM marketing
WHERE network <> 'ga4'
GROUP BY date, network, lower(campaign_name)
),
visits AS (
SELECT date, lower(campaign_name) AS campaign_key,
sum("extra.sessions") AS sessions,
sum("extra.engaged_sessions") AS engaged_sessions
FROM marketing
WHERE network = 'ga4'
GROUP BY date, lower(campaign_name)
)
SELECT s.date, s.network, s.campaign_key, s.currency, s.cost, s.clicks,
v.sessions, v.engaged_sessions,
s.cost / NULLIF(v.sessions, 0) AS cost_per_session
FROM spend s
LEFT JOIN visits v
ON v.date = s.date AND v.campaign_key = s.campaign_key;
Filter the GA4 block on source / medium (adgroup_id) as well when one campaign name is used on more than one platform, so that Meta spend does not meet Google traffic.
Why clicks and sessions do not match
The ad platform counts clicks and Analytics counts sessions. Google's discrepancy help gives these reasons they drift apart:
- One person clicks the same ad several times in one session: several clicks, one session.
- A person clicks once, then returns later from a bookmark: one click, several sessions.
- A person leaves before the page loads: a click, no session.
- Google Ads removes invalid clicks from its reports, while Analytics still counts those visits.
Watch the gap as a trend, not an error: a sudden drop in sessions per click for one campaign often points to a broken landing page or lost tagging.
Keep the days in step
GA4 dates are in the property's time zone. If your ad accounts report in another time zone, a day does not cover the same hours on both sides. Each routine GA4 sync pulls the last 13 days again, and a Google Ads sync the last 31 days, so recent days on either side can still change after your query runs.