GA360 Standard

GA360 Standard

10 data marts71 fieldsView on GitHub

Devices6 fields1 relationshipEvent Info4 fields1 relationshipEvents6 fields2 relationshipsGeo4 fields1 relationshipPages4 fields1 relationshipPageviews6 fields2 relationshipsSessions22 fields7 relationshipsTraffic Sources6 fields1 relationshipTransactions6 fields1 relationshipUsers7 fields1 relationship

The Google Analytics 360 export to BigQuery as ten Data Marts: sessions at the hub, with the page views, events and purchases that join them and the locations, devices, traffic sources, users, pages and event details behind them.

Overview

A ready-made reporting layer over the Google Analytics 360 export to BigQuery. It turns the daily ga_sessions_* tables into ten analytics-ready tables: sessions, page views, events and purchases, plus the locations, devices, traffic sources, users, pages and event details they point at by hash. Two staging tables sit between the export and most tables: _temp_objects feeds page views, events, pages and event details, and _temp_transactions feeds purchases, on Transactions and on Sessions.

The SQL that builds the tables is part of the model, in references/sql-transformation, with a runbook for the first load and the daily run. It is written for the OWOX Transformations plugin in the BigQuery (GoogleSQL) dialect, and you can adapt it to your needs.

Sessions are the hub, one row per session of the export. Page views, events and purchases join them on date and sessionId together. The dimension tables carry no date: each run appends the same hashes again, so deduplicate them before joining in your own SQL. Revenue is in millionths, as Google's export stores it: divide by 1,000,000.

Example Questions

  • Which sources and campaigns bring the sessions that end in a purchase?
  • Which landing pages bring the most purchase revenue on mobile?
  • Which pages do visitors from each country view most?

Explore on canvas →

Devices Data Mart

Devices

The device a session ran on: category, browser and its version, operating system and its version, one row per combination, as the GA 360 export records them. Sessions point here through deviceHash, a FARM_FINGERPRINT of the five values. The table has no date, so a hash repeats once per run (once per day for daily runs). Count distinct hashes. In your own SQL over these tables, deduplicate it before joining, or rows multiply; OWOX Data Marts reports collapse joined fields per source row.

Fields

ColumnTypeAliasDescription
deviceHashSTRINGDevice HashPK. FARM_FINGERPRINT of the five device values in the order listed here, joined without a separator, with an empty value in place of NULL. Unique within one run; repeats across daily runs.
deviceCategorySTRINGDevice CategoryThe device category, such as desktop, mobile or tablet.
browserSTRINGBrowserThe browser, such as Chrome or Safari.
browserVersionSTRINGBrowser VersionThe version of the browser.
operatingSystemSTRINGOperating SystemThe operating system, such as Windows, iOS or Android.
operatingSystemVersionSTRINGOperating System VersionThe version of the operating system.

Event Info Data Mart

Event Info

The category, action and label behind event hits, one row per combination, as the site sent them. Events point here through their pageHash column, which despite its name holds this table's eventHash, a FARM_FINGERPRINT of the three values. Each run adds the combinations of its own window. The table has no date, so a hash repeats once per run (once per day for daily runs). Count distinct hashes. In your own SQL over these tables, deduplicate it before joining, or rows multiply; OWOX Data Marts reports collapse joined fields per source row.

Fields

ColumnTypeAliasDescription
eventHashSTRINGEvent HashPK. FARM_FINGERPRINT of category, action and label, joined without a separator, with an empty value in place of NULL. Unique within one run; repeats across daily runs. Events carry it as pageHash.
eventCategorySTRINGEvent CategoryThe event category the site sent.
eventActionSTRINGEvent ActionThe event action the site sent.
eventLabelSTRINGEvent LabelThe event label the site sent. Empty when the event had none.

Events Data Mart

Events

Every event hit of the GA 360 export, one row each, tied to the session it fell in. Join to Sessions on date and sessionId together. Despite its name, pageHash holds the event hash: it joins Event Info, which carries the event's category, action and label. hitId identifies an event: a rerun of the same window gives the same value, a different window does not, and Pageviews numbers its hits separately. time is a timestamp in milliseconds since 1970-01-01 UTC; date is the day in the property's time zone.

Fields

ColumnTypeAliasDescription
dateDATEDatePK. The day of the export table the event was read from, in the property's time zone.
sessionIdSTRINGSession IDPK. The session the event belongs to: the full visitor ID and the visit ID, joined by _. Join to Sessions on this and date together. FK to Sessions
hitIdSTRINGHit IDPK. MD5 of the session ID, the hit's time in the session and its order among the session's events. Stable for a rerun of the same window, not across different windows.
timeINTEGEREvent TimeTimestamp of the event, in milliseconds since 1970-01-01 UTC: the session start plus the hit's offset.
eventsINTEGEREventsAlways 1. Sum it to count events.
pageHashSTRINGEvent HashDespite its name, the event hash: FARM_FINGERPRINT of the event's category, action and label. It joins eventHash in Event Info, not Pages. FK to Event Info

Relationships

Related data martOnCardinalityMeaning
Sessionsdate = date, sessionId = sessionIdN:1The session the event fell in.
Event InfopageHash = eventHashN:1The event's category, action and label; the hash repeats across runs.

Geo Data Mart

Geo

Where a session came from: country, region and city, one row per combination, as the GA 360 export records them. Sessions point here through geoHash, a FARM_FINGERPRINT of the three values. The table has no date, so a hash repeats once per run (once per day for daily runs). Count distinct hashes. In your own SQL over these tables, deduplicate it before joining, or rows multiply; OWOX Data Marts reports collapse joined fields per source row.

Fields

ColumnTypeAliasDescription
geoHashSTRINGGeo HashPK. FARM_FINGERPRINT of country, region and city, joined without a separator, with an empty value in place of NULL. Unique within one run; repeats across daily runs.
countrySTRINGCountryThe session's country, as the export records it.
regionSTRINGRegionThe session's region or state, as the export records it.
citySTRINGCityThe session's city, as the export records it.

Pages Data Mart

Pages

The pages behind page views: host name, path and title, one row per combination. The path is cut at the first ?, # or ;, so query strings and anchors are dropped. The title is part of the key, so one path with two titles is two pages. Page views point here through pageHash, a FARM_FINGERPRINT of host, path and title. Each run adds the pages of its own window. The table has no date, so a hash repeats once per run (once per day for daily runs). Count distinct hashes. In your own SQL over these tables, deduplicate it before joining, or rows multiply; OWOX Data Marts reports collapse joined fields per source row.

Fields

ColumnTypeAliasDescription
pageHashSTRINGPage HashPK. FARM_FINGERPRINT of host name, path and title, joined without a separator, with an empty value in place of NULL. Unique within one run; repeats across daily runs.
hostNameSTRINGHost NameThe host name of the page, such as www.example.com.
pagePathSTRINGPage PathThe path of the page, cut at the first ?, # or ;.
pageTitleSTRINGPage TitleThe title of the page, as the browser sent it.

Pageviews Data Mart

Pageviews

Every page view hit of the GA 360 export, one row each, tied to the session it fell in. Join to Sessions on date and sessionId together, and to Pages on pageHash for the host, path and title: the table holds no page path itself. hitId identifies a page view: a rerun of the same window gives the same value, a different window does not, and Events numbers its hits separately. time is a timestamp in milliseconds since 1970-01-01 UTC; date is the day in the property's time zone.

Fields

ColumnTypeAliasDescription
dateDATEDatePK. The day of the export table the page view was read from, in the property's time zone.
sessionIdSTRINGSession IDPK. The session the page view belongs to: the full visitor ID and the visit ID, joined by _. Join to Sessions on this and date together. FK to Sessions
hitIdSTRINGHit IDPK. MD5 of the session ID, the hit's time in the session and its order among the session's page views. Stable for a rerun of the same window, not across different windows.
timeINTEGERPage View TimeTimestamp of the page view, in milliseconds since 1970-01-01 UTC: the session start plus the hit's offset.
pageviewINTEGERPageviewsAlways 1. Sum it to count page views.
pageHashSTRINGPage HashFARM_FINGERPRINT of the page's host name, path and title. FK to Pages

Relationships

Related data martOnCardinalityMeaning
Sessionsdate = date, sessionId = sessionIdN:1The session the page view fell in.
PagespageHash = pageHashN:1The host, path and title of the page viewed; the hash repeats across runs.

Sessions Data Mart

Sessions

One row per session of the GA 360 export, with its landing page, engagement, purchases and the keys to its location, device, traffic source and user. A row is identified by date together with sessionId; page views, events and purchases join on both. visitStartTime is in seconds since 1970, and timeOnSite is in whole seconds with the fraction cut off, so a one-hit session shows 0. Purchases are deduplicated the same way as in Transactions. transactionRevenue is in millionths, as Google's export stores it: divide by 1,000,000. cost, impressions and clicks are always 0, slots for ad cost blended in later.

Fields

ColumnTypeAliasDescription
dateDATEDatePK. The day of the export table the session was read from, in the property's time zone.
sessionIdSTRINGSession IDPK. The full visitor ID and the visit ID, joined by _. Pair it with date: page views, events and purchases join on both.
landingPageSTRINGLanding PagePath of the session's first hit marked as an entrance, or of its first hit when none is, cut at the first ?, # or ;.
landingHostSTRINGLanding HostHost name of the same hit as landingPage.
visitStartTimeINTEGERSession Start TimeWhen the session started, in seconds since 1970-01-01 UTC, as the export records it.
visitNumberINTEGERSession NumberThe visitor's session count as Google Analytics reports it: 1 for a first visit.
touchpointSTRINGTouchpointAlways WEB.
dataSourceSTRINGData SourceThe export the session was read from, as project.dataset.ga_sessions_*.
hitsINTEGERHitsAll hits in the session as the export counts them (totals.hits), hit types other than page views and events included.
pageviewsINTEGERPageviewsNumber of page view hits in the session.
eventsINTEGEREventsNumber of event hits in the session.
bouncesINTEGERBounces1 when the session has at most one hit that is a page view or an interactive event, otherwise 0.
timeOnSiteINTEGERTime on Site (seconds)Time from the session's first hit to its last, in whole seconds with the fraction cut off. 0 for a session with one hit.
userHashSTRINGUser HashFARM_FINGERPRINT of the session's client ID; the other user identifiers are empty. When the export has no client ID, every session has the same hash. FK to Users
geoHashSTRINGGeo HashFARM_FINGERPRINT of the session's country, region and city. FK to Geo
deviceHashSTRINGDevice HashFARM_FINGERPRINT of the session's device category, browser and version, operating system and version. FK to Devices
trafficSourceHashSTRINGTraffic Source HashFARM_FINGERPRINT of the session's source, medium, campaign, keyword and ad content. FK to Traffic Sources
transactionsINTEGERPurchasesPurchases in the session, deduplicated by transaction ID the same way as in Transactions. 0 when none.
transactionRevenueFLOATPurchase Revenue (millionths)Revenue of those purchases, multiplied by 1,000,000 as Google's export stores it; divide by 1,000,000 for the amount. 0 when none.
impressionsINTEGERImpressionsAlways 0. A slot for ad impressions blended in later.
clicksINTEGERClicksAlways 0. A slot for ad clicks blended in later.
costFLOATCostAlways 0. A slot for ad cost blended in later.

Relationships

Related data martOnCardinalityMeaning
GeogeoHash = geoHashN:1Where the session came from; the hash repeats across runs.
DevicesdeviceHash = deviceHashN:1The device the session ran on; the hash repeats across runs.
Traffic SourcestrafficSourceHash = trafficSourceHashN:1The session's source and campaign; the hash repeats across runs.
UsersuserHash = userHashN:1The browser behind the session, by client ID; one shared hash when the export has none.

Traffic Sources Data Mart

Traffic Sources

The source, medium, campaign, keyword and ad content Google Analytics attributed a session to, one row per combination. They are read as they are from the export's trafficSource record, such as google / organic, (direct) / (none), or the UTM tags of a campaign. Sessions point here through trafficSourceHash, a FARM_FINGERPRINT of the five values. The table has no date, so a hash repeats once per run (once per day for daily runs). Count distinct hashes. In your own SQL over these tables, deduplicate it before joining, or rows multiply; OWOX Data Marts reports collapse joined fields per source row.

Fields

ColumnTypeAliasDescription
trafficSourceHashSTRINGTraffic Source HashPK. FARM_FINGERPRINT of source, medium, campaign, keyword and ad content, joined without a separator, with an empty value in place of NULL. Unique within one run; repeats across daily runs.
sourceSTRINGSourceWhere the session came from, from trafficSource.source, such as google or (direct).
mediumSTRINGMediumThe kind of traffic, from trafficSource.medium, such as organic, cpc, referral or (none).
campaignSTRINGCampaignThe campaign name, from trafficSource.campaign.
keywordSTRINGKeywordThe keyword or search term, from trafficSource.keyword.
adContentSTRINGAd ContentThe ad variant, from trafficSource.adContent.

Transactions Data Mart

Transactions

One row per purchase, deduplicated by transaction ID: when the export records the same ID more than once within the deduplication window (7 days in the runbook's setup), only the earliest is kept, so there is at most one row per ID per deduplication window. transactionRevenue is in millionths, as Google's export stores it: divide by 1,000,000. status is always empty and touchpoint is always WEB; both are slots. Join to Sessions on date and sessionId for the source, device and location behind each order. The purchase counts on Sessions are deduplicated the same way.

Fields

ColumnTypeAliasDescription
dateDATEDatePK. The day of the export table the purchase was read from, in the property's time zone.
sessionIdSTRINGSession IDPK. The session the purchase was made in: the full visitor ID and the visit ID, joined by _. Join to Sessions on this and date together. FK to Sessions
transactionIdSTRINGTransaction IDPK. The order ID the site sent with the purchase. At most one row per ID per deduplication window: the earliest.
transactionRevenueFLOATRevenue (millionths)Revenue of the purchase, multiplied by 1,000,000 as Google's export stores it; divide by 1,000,000 for the amount.
statusSTRINGStatusAlways empty. A slot for an order status from another source.
touchpointSTRINGTouchpointAlways WEB.

Relationships

Related data martOnCardinalityMeaning
Sessionsdate = date, sessionId = sessionIdN:1The session the purchase was made in.

Users Data Mart

Users

The visitors behind sessions, one row per client ID: the identifier Google Analytics gives a browser, not a person. The model builds a user from clientId alone; the other identifier columns are always empty, slots for other sources. Where the export carries no clientId, as in Google's public sample, every session lands on one user hash and this table holds one row per run. Sessions point here through userHash. The table has no date, so a hash repeats once per run (once per day for daily runs). Count distinct hashes. In your own SQL over these tables, deduplicate it before joining, or rows multiply; OWOX Data Marts reports collapse joined fields per source row.

Fields

ColumnTypeAliasDescription
userHashSTRINGUser HashPK. FARM_FINGERPRINT of the six identifiers below, joined without a separator, with an empty value in place of NULL; today the client ID alone. Unique within one run; repeats across daily runs.
clientIdSTRINGClient IDThe export's clientId: one browser. Empty in exports that do not carry it, Google's public sample included.
userIdSTRINGUser IDAlways empty. A slot for your own user ID.
visitorIdSTRINGVisitor IDAlways empty. A slot for a visitor ID from another source.
userPseudoIdSTRINGPseudo User IDAlways empty. A slot for a GA4 pseudo user ID.
phoneSTRINGPhoneAlways empty. A slot for a phone number from your CRM.
emailSTRINGEmailAlways empty. A slot for an email address from your CRM.

Apply to your project

  1. 1

    Install the Import Model plugin

    One plugin, installed once, in your own OWOX workspace.

    Get the plugin →

  2. 2

    Import this model

    Point it at this bundle and it creates every data mart above, joins and all.

    Open the model →

  3. 3

    Plug in your data and destinations

    Connect your own sources and send the results where your team already works.

    Browse connectors →

4. Optional — customize as you wish. Rename a column, drop a mart, add your own: once it is imported it is yours, and nothing here syncs back.