Skip to main content

Session presets

By default the package will create a table with the standard schema. But you could use presets to extend the schema. Or you could add your own columns to the result table using helper methods:

Apply extend preset#

Here is an example, how to apply an extended preset:

const sessions = new ga4.Sessions(sessionConfig);sessions.applyPreset("extended");sessions.publish();

You could compare schemas for standard and extended presets below.

Standard schema#

column_namedata_typedescription
session_idINT64Session id based on ga_session_id and user_pseudo_id
user_pseudo_idSTRINGGA client ID
user_idSTRINGUser ID if provided
session_referrerSTRINGReferrer of a landing page
dateDATEDate of the first session event
session_startTIMESTAMPTime of the first event of the session
session_endTIMESTAMPTime of the last event of the session
session_engagedINT64If session is engaged the value will be 1 otherwise 0
gclidSTRINGGoogle click id from event_params
countrySTRINGThe first geo.country not null value during the session
device_categorySTRINGThe first device.category not null value during the session
languageSTRINGThe first device.language not null value during the session
termSTRINGString value of the term key from event_params
contentSTRINGString value of the content key from event_params
landing_pageSTRUCT<href STRING, host STRING, path STRING>Landing page href, host and path
last_click_attributionSTRUCT<source STRING, medium STRING, campaign STRING, channel STRING>Last Click Attribution
last_non_direct_attributionSTRUCT<source STRING, medium STRING, campaign STRING, channel STRING>Last Non Direct Click Attribution

Extended schema#

column_namedata_typedescription
session_idINT64Session id based on ga_session_id and user_pseudo_id
user_pseudo_idSTRINGGA client ID
user_idSTRINGUser ID if provided
session_referrerSTRINGReferrer of a landing page
dateDATEDate of the first session event
session_startTIMESTAMPTime of the first event of the session
session_endTIMESTAMPTime of the last event of the session
session_engagedINT64If session is engaged the value will be 1 otherwise 0
gclidSTRINGGoogle click id from event_params
privacy_infoSTRUCT<analytics_storage STRING, ads_storage STRING, uses_transient_token STRING>Privacy info column for the first session event
device_categorySTRINGThe first device.category not null value during the session
mobile_model_nameSTRINGThe first device.mobile_model_name not null value during the session
mobile_marketing_nameSTRINGThe first device.mobile_marketing_name not null value during the session
mobile_os_hardware_modelSTRINGThe first device.mobile_os_hardware_model not null value during the session
operating_systemSTRINGThe first device.operating_system not null value during the session
operating_system_versionSTRINGThe first device.operating_system_version not null value during the session
vendor_idSTRINGThe first device.vendor_id not null value during the session
advertising_idSTRINGThe first device.advertising_id not null value during the session
languageSTRINGThe first device.language not null value during the session
is_limited_ad_trackingSTRINGThe first device.is_limited_ad_tracking not null value during the session
time_zone_offset_secondsINT64The first device.time_zone_offset_seconds not null value during the session
browserSTRINGThe first device.web_info.browser not null value during the session
browser_versionSTRINGThe first device.web_info.browser_version not null value during the session
hostnameSTRINGThe first device.web_info.hostname not null value during the session
continentSTRINGThe first geo.continent not null value during the session
countrySTRINGThe first geo.country not null value during the session
regionSTRINGThe first geo.region not null value during the session
citySTRINGThe first geo.city not null value during the session
sub_continentSTRINGThe first geo.sub_continent not null value during the session
metroSTRINGThe first geo.metro not null value during the session
stream_idSTRINGstream_id column for the first session event
platformSTRINGplatform column for the first session event
termSTRINGString value of the term key from event_params
contentSTRINGString value of the content key from event_params
landing_pageSTRUCT<href STRING, host STRING, path STRING>Landing page href, host and path
last_click_attributionSTRUCT<source STRING, medium STRING, campaign STRING, channel STRING>Last Click Attribution
last_non_direct_attributionSTRUCT<source STRING, medium STRING, campaign STRING, channel STRING>Last Non Direct Click Attribution