ETLMCPData Conveyance Works
Log in Start free
Docs

GA4 campaigns renamed during a day: merged rows and empty user counts

Why a GA4 campaign renamed during a day shows one row under one of its names, with sessions and revenue summed and total_users and new_users left empty.

Coming This connector is coming.

If you rename a campaign in the middle of a day, Google Analytics can report that day's traffic for the one campaign id under two names. When the GA4 connector is available, etlmcp stores a single row for that day, campaign and source / medium: it adds the two rows together and keeps the name it read first. Sessions, engaged sessions, views, key events, orders and revenue are summed. total_users and new_users are left empty on that merged row, because a person can be counted in both of the rows Google returned, and adding them would count that person twice.

Why GA4 returns two rows for one campaign

etlmcp asks the Google Analytics Data API for four dimensions: the date, sessionCampaignId, sessionCampaignName and sessionSourceMedium. Google's API reference describes both campaign dimensions as belonging to a session, and each report row holds one value for every dimension in the request. Google's help page on traffic-source scopes explains that a session-scoped dimension gets a new value each time a user comes back and starts a session. So sessions that began before your rename carry the old name, sessions that began after it carry the new one, and the same id comes back on two rows for that day.

How etlmcp merges them

The connector keys each row on three things: the date, the campaign id and the source / medium. Two rows that share all three become one:

  • Additive metrics are summed. sessions, engaged_sessions, page_views, key_events, orders and revenue hold the total of both rows.
  • User counts are left out. Google defines totalUsers as distinct users, and the connector marks total_users and new_users as not additive. On a merged row neither value is written.
  • One name is kept. campaign_name is the first name the connector read for that key. etlmcp asks Google to sort the report by date, campaign id, campaign name and source / medium, so that order follows the names themselves, not the time of the rename. The name kept can be the old one or the new one.

Only a day on which one key comes back under two names is affected. On a day when the campaign carries a single name, it has one row per source / medium, and its user counts are filled in.

Rows without a campaign id

When Google reports no campaign id, or reports it as (not set), the connector keys the row on the campaign name instead, and that name is also written to campaign_id. A row with no name at all gets (not set) as its name, and a missing source / medium is stored as (not set) too. Two campaigns that share a name and have no id therefore end up on one row for the same day and source / medium, merged the same way, with empty user counts.

What an empty user count looks like in your data

A merged row has no value in the two user columns. A CSV export writes an empty cell, and PostgreSQL stores NULL. If a campaign shows sessions but blank users on one day, a rename on that day is the likely cause.

A column that is blank on every row of a property has another cause. When your Analytics role is barred from a kind of data, such as revenue or cost, Google's report metadata lists the restricted metrics, and the connector leaves each one out of every row instead of writing a zero. User counts are not one of those kinds.

Working with merged days

  • Group by campaign_id, never by campaign_name, when you total a campaign over time. The connector keys each row on the id, while the name can change from one day to the next.
  • To show one current name per campaign, take the name from the most recent date for each id and join it back on campaign_id.
  • Do not fill blank user counts by adding up other rows. Google counts distinct users, so one person can sit in several days, campaigns or source / medium pairs. Use sessions when you need a figure you can sum.
  • If you need users for the day of a rename, read them in Google Analytics itself for that campaign and day.

The full list of GA4 fields and how each is defined is on the GA4 connector page.

Related

Sources

  1. Scopes of traffic-source dimensions — support.google.com, checked
  2. API dimensions and metrics — developers.google.com, checked
  3. Row — developers.google.com, checked
  4. ResponseMetaData — developers.google.com, checked