You must be Signed In to watch
Create table
If you’re using Data Tag + Data Client your events will contain:
- Cookie data
- Consent state
- Default fields like event_name
- All other data you add to dataLayer.push
Example event
{
"event": "view_promotion",
"gtm": {
"uniqueEventId": 99,
"priorityId": 5,
"start": 1740899517250,
"historyChangeSource": "pushState",
"oldUrlFragment": "",
"newUrlFragment": "",
"oldHistoryState": {
"url": "/[context]?context=default",
"as": "/",
"options": {
"_h": 1,
"shallow": false,
"_shouldResolveHref": true
},
"__N": true,
"key": "abc123xyz"
},
"newHistoryState": {
"url": "/catalog",
"as": "/catalog",
"options": {
"_shouldResolveHref": true
},
"__N": true,
"key": "xyz789abc"
},
"oldUrl": "https://fictionalshop.com/",
"newUrl": "https://fictionalshop.com/catalog",
"triggers": "45"
},
"url_passthrough": false,
"developer_id": {
"xyz123abc": true
},
"ads_data_redaction": true,
"page_url": "/catalog",
"page_title": "Catalog - FictionalShop",
"ecommerce": {
"promotion_id": "promo123XYZ",
"promotion_name": "Electronics Sale",
"creative_slot": "Homepage_Banner_1",
"creative_name": null,
"items": []
},
"meta": null,
"page_location": "https://fictionalshop.com/catalog",
"page_hostname": "fictionalshop.com",
"page_referrer": "",
"page_encoding": "UTF-8",
"screen_resolution": "1920x1080",
"viewport_size": "1920x500",
"consent_state": {
"ad_storage": false,
"ad_user_data": false,
"ad_personalization": false,
"analytics_storage": false,
"functionality_storage": true,
"personalization_storage": true,
"security_storage": true
},
"common_cookie": {
"_fbp": "fb.1.1740259821138.123456789012345678"
},
"event_name": "view_promotion",
"v": 2
}
Create events table
Replace
dataset_name
andtable_name
with your own
CREATE TABLE dataset_name.table_name (
client_id STRING,
event_name STRING,
timestamp INTEGER,
common_cookie STRUCT<
_fbp STRING,
_fbc STRING,
stape STRING,
_gtmeec STRING,
ttclid STRING,
_ttp STRING,
_epik STRING,
_scid STRING,
_scclid STRING
>,
consent_state STRUCT<
ad_personalization BOOLEAN,
ad_storage BOOLEAN,
ad_user_data BOOLEAN,
analytics_storage BOOLEAN,
functionality_storage BOOLEAN,
personalization_storage BOOLEAN,
security_storage BOOLEAN
>,
page_encoding STRING,
page_hostname STRING,
page_location STRING,
page_referrer STRING,
page_title STRING,
page_url STRING,
screen_resolution STRING,
viewport_size STRING,
ads_data_redaction BOOLEAN
);