dating_platform/activities.view.lookml 48 dims21 measures 4 warnings Repo files

LookML view · dating-platform

How this LookML events view models page views, pings, transactions and usage time

At a glance

Does
A derived table over events_atomic with page, referer, structured event and ecommerce columns. It defines event, page view, ping and transaction counts, per-session and per-visitor ratios, and an approximate usage time.Trust: Source-defined
Why
Event-level engagement for the dating site: how many pages and pings a session produces and how often sessions end in a transaction.Trust: Inferred
Grain
One row per tracked event, keyed by event_id, which is the declared primary key. Rows without a domain_userid are dropped.Trust: Source-defined
Source
dating_platform/activities.view.lookml 338 lines
Source: activities.view.lookml L1-10
dating_platform/activities.view.lookmlL1-10
- view: events  derived_table:    sql: |      SELECT      app_id,      domain_userid,      domain_sessionidx,      event_id,      event,      collector_tstamp,      dvce_tstamp,      page_title,      page_urlscheme,

dating-platform, activities.view.lookml, lines 1-10

Shape

Trust: Source-defined

Every field as declared, with the dashboard tiles that read it. Computed from the source; nothing here is edited.

Derived table: rebuilt on a SQL trigger. Reads warehouse tables directly.

Dimensions 48

NameTypeSQLUsed byTags
event_idL57string${TABLE}.event_id-primary key
event_typeL60string${TABLE}.event-
timestampL62string${TABLE}.collector_tstamp-name reused
timestamptime, date, week, monthL64time group${TABLE}.collector_tstamp-name reused
session_indexL72number${TABLE}.domain_sessionidx-
user_idL75string${TABLE}.domain_userid-
session_idL77string${TABLE}.domain_userid || '-' || ${TABLE}.domain_sessionidx-derived
device_timestamptime, date, week, monthL79time group${TABLE}.dvce_tstamp-hidden
page_titleL88string${TABLE}.page_title-
page_url_schemeL90string${TABLE}.page_urlscheme-
page_url_hostL92string${TABLE}.page_urlhost-
page_url_pathL94string${TABLE}.page_urlpath-
page_url_portL96int${TABLE}.page_urlport-hidden
page_url_queryL100string${TABLE}.page_urlquery-hidden
page_url_fragmentL103string${TABLE}.page_urlfragment-hidden
refr_mediumL106string${TABLE}.refr_medium-
first_event_in_sessionL108yesno${TABLE}.refr_medium != 'internal'-derived
first_event_for_visitorL111yesno
${TABLE}.refr_medium != 'internal' AND ${TABLE}.domai...${TABLE}.refr_medium != 'internal' AND ${TABLE}.domain_sessionidx = 1
-derived
refr_sourceL114string${TABLE}.refr_source-
refr_termL116string${TABLE}.refr_term-
refr_url_hostL118string${TABLE}.refr_urlhost-
refr_url_pathL120string${TABLE}.refr_urlpath-
x_offsetL122int${TABLE}.pp_xoffset_max-
pp_xoffset_minL125int${TABLE}.pp_xoffset_min-hidden
y_offsetL129int${TABLE}.pp_yoffset_max-
pp_yoffset_minL132int${TABLE}.pp_yoffset_min-hidden
structured_event_actionL136string${TABLE}.se_action-
structured_event_categoryL138string${TABLE}.se_category-
structured_event_labelL140string${TABLE}.se_label-
structured_event_propertyL142string${TABLE}.se_property-
structured_event_valueL144number${TABLE}.se_value-
user_agentL147string${TABLE}.useragent-hidden
page_heightL150int${TABLE}.doc_height-
page_widthL153int${TABLE}.doc_width-
transaction_order_idL156string${TABLE}.tr_orderid-
transaction_affiliationL158string${TABLE}.tr_affiliation-
transaction_valueL160number${TABLE}.tr_total-
transaction_taxL164number${TABLE}.tr_tax-
transaction_address_cityL168string${TABLE}.tr_city-
transaction_address_stateL170string${TABLE}.tr_state-
transaction_address_countryL172string${TABLE}.tr_country-
transaction_item_order_idL174string${TABLE}.ti_orderid-
transaction_item_categoryL176string${TABLE}.ti_category-
transaction_item_skuL178string${TABLE}.ti_sku-
transaction_item_nameL180string${TABLE}.ti_name-
transaction_item_priceL182number${TABLE}.ti_price-
transaction_item_quantityL186int${TABLE}.ti_quantity-
transaction_items_listL189string${transaction_order_id}-derived

Measures 21

NameTypeSQLUsed byTags
countL191countCOUNT(*) of rows-
page_pings_countL194countCOUNT(*) of rowsfilters: event_type = page_ping-filtered
page_views_countL199countCOUNT(*) of rowsfilters: event_type = page_view-filtered
transactions_countL204count_distinct${transaction_order_id}filters: event_type = transaction-derivedfiltered
distinct_pages_viewed_countL210count_distinct${page_url_path}-derived
sessions_countL214count_distinct${session_id}-derived
page_pings_per_sessionL218number
NULLIF(${page_pings_count},0)/NULLIF(${sessions_count...NULLIF(${page_pings_count},0)/NULLIF(${sessions_count},0)::REAL
-derived
page_pings_per_visitorL222number
NULLIF(${page_pings_count},0)/NULLIF(${visitors_count...NULLIF(${page_pings_count},0)/NULLIF(${visitors_count},0)::REAL
-derived
transactions_per_sessionL226number
NULLIF(${transactions_count},0)/NULLIF(${sessions_cou...NULLIF(${transactions_count},0)/NULLIF(${sessions_count},0)::REAL
-derived
transactions_per_visitorL230number
NULLIF(${transactions_count},0)/NULLIF(${visitors_cou...NULLIF(${transactions_count},0)/NULLIF(${visitors_count},0)::REAL
-derived
visitors_countL234count_distinct${user_id}-hiddenderived
events_per_sessionL239number${count}/NULLIF(${sessions_count},0)::REAL-derived
events_per_visitorL243number${count}/NULLIF(${visitors_count},0)::REAL-derived
page_views_per_sessionsL247number${page_views_count}/NULLIF(${sessions_count},0)::REAL-derived
page_views_per_visitorL251number${page_views_count}/NULLIF(${visitors_count},0)::REAL-derived
landing_page_views_countL255countCOUNT(*) of rowsfilters: event_type = page_view, first_event_in_session = true-filtered
internal_page_views_countL260countCOUNT(*) of rowsfilters: event_type = page_view, first_event_in_session = false-filtered
approx_user_usage_in_minutesL265number
APPROXIMATE COUNT( DISTINCT CONCAT(FLOOR(EXTRACT (EPO...APPROXIMATE COUNT( DISTINCT CONCAT(FLOOR(EXTRACT (EPOCH FROM ${TABLE}.collector_tstamp)/10), ${TABLE}.domain_userid) ) /6
-derived
approx_usage_per_visitor_in_secondsL270number
${approx_user_usage_in_minutes}/NULLIF(${visitors_cou...${approx_user_usage_in_minutes}/NULLIF(${visitors_count}, 0)::REAL
-derived
approx_usage_per_visit_in_secondsL274number
${approx_user_usage_in_minutes}/NULLIF(${sessions_cou...${approx_user_usage_in_minutes}/NULLIF(${sessions_count}, 0)::REAL
-derived
transactions_valueL278sum${transaction_value}filters: event_type = transaction-derivedfiltered

Relationships

Trust: Source-defined

No joins, no upstream views and no dashboard tiles reference this view. It is an island in the model.

Relationships of events
Relationships of events. Text version follows the diagram.This viewUsed by: explores, views, dashboardsbase view events explore in event_tracker
  • This Block
Text version
  • events is the base view of events: base view

Filters and exclusions that change meaning

Events without a user id are excluded

Trust: Source-defined

The derived table keeps only domain_userid IS NOT NULL. Events from clients that never set the cookie are invisible to every measure.

Source: activities.view.lookml L47-50
dating_platform/activities.view.lookmlL47-50
      ti_sku,      ti_name,      ti_price,      ti_quantity      FROM ${TABLE}.events_atomic      WHERE domain_userid IS NOT NULL    sql_trigger_value: SELECT MAX(collector_tstamp) FROM ${TABLE}.events_atomic    distkey: domain_userid    sortkeys:    - domain_userid

dating-platform, activities.view.lookml, lines 47-50

Worth noticing

Landing page views are inferred from the referer

Trust: Source-defined

first_event_in_session is true when refr_medium != 'internal'. landing_page_views_count counts page views where that flag is true.

Source: activities.view.lookml L108-113
dating_platform/activities.view.lookmlL108-113
    hidden: true  - dimension: refr_medium    sql: ${TABLE}.refr_medium  - dimension: first_event_in_session    type: yesno    sql: ${TABLE}.refr_medium != 'internal'  - dimension: first_event_for_visitor    type: yesno    sql: ${TABLE}.refr_medium != 'internal' AND ${TABLE}.domain_sessionidx = 1  - dimension: refr_source    sql: ${TABLE}.refr_source  - dimension: refr_term

dating-platform, activities.view.lookml, lines 108-113

Usage time counts active 10-second buckets

Trust: Source-defined

approx_user_usage_in_minutes counts distinct 10-second windows per user with APPROXIMATE COUNT(DISTINCT ...) and divides by 6 to get minutes.

Source: activities.view.lookml L265-277
dating_platform/activities.view.lookmlL265-277
    filters:      event_type: page_view      first_event_in_session: false  - measure: approx_user_usage_in_minutes    type: number    decimals: 2    sql: APPROXIMATE COUNT( DISTINCT CONCAT(FLOOR(EXTRACT (EPOCH FROM ${TABLE}.collector_tstamp)/10),      ${TABLE}.domain_userid) ) /6  - measure: approx_usage_per_visitor_in_seconds    type: number    decimals: 2    sql: ${approx_user_usage_in_minutes}/NULLIF(${visitors_count}, 0)::REAL  - measure: approx_usage_per_visit_in_seconds    type: number    decimals: 2    sql: ${approx_user_usage_in_minutes}/NULLIF(${sessions_count}, 0)::REAL  - measure: transactions_value    type: sum    sql: ${transaction_value}

dating-platform, activities.view.lookml, lines 265-277

What can change the answer 4

Caution: Seconds measures are computed from minutes

Trust: Source-defined

approx_usage_per_visitor_in_seconds and approx_usage_per_visit_in_seconds divide approx_user_usage_in_minutes by visitors or sessions without multiplying by 60.

What goes wrong: A visitor with 3 minutes of activity shows as 3 seconds, so usage looks 60 times lower than it is.

Source: activities.view.lookml L265-277
dating_platform/activities.view.lookmlL265-277
    filters:      event_type: page_view      first_event_in_session: false  - measure: approx_user_usage_in_minutes    type: number    decimals: 2    sql: APPROXIMATE COUNT( DISTINCT CONCAT(FLOOR(EXTRACT (EPOCH FROM ${TABLE}.collector_tstamp)/10),      ${TABLE}.domain_userid) ) /6  - measure: approx_usage_per_visitor_in_seconds    type: number    decimals: 2    sql: ${approx_user_usage_in_minutes}/NULLIF(${visitors_count}, 0)::REAL  - measure: approx_usage_per_visit_in_seconds    type: number    decimals: 2    sql: ${approx_user_usage_in_minutes}/NULLIF(${sessions_count}, 0)::REAL  - measure: transactions_value    type: sum    sql: ${transaction_value}

dating-platform, activities.view.lookml, lines 265-277

Caution: NULL referers are not landing views

Trust: Inferred

When refr_medium is NULL, refr_medium != 'internal' is NULL, so the event is neither a landing view nor an internal view.

What goes wrong: Direct traffic with no referer can drop out of both landing_page_views_count and internal_page_views_count.

Read the guide: Filters that change metric meaning

Source: activities.view.lookml L108-110
dating_platform/activities.view.lookmlL108-110
    hidden: true  - dimension: refr_medium    sql: ${TABLE}.refr_medium  - dimension: first_event_in_session    type: yesno    sql: ${TABLE}.refr_medium != 'internal'  - dimension: first_event_for_visitor    type: yesno    sql: ${TABLE}.refr_medium != 'internal' AND ${TABLE}.domain_sessionidx = 1

dating-platform, activities.view.lookml, lines 108-110

Caution: user_agent reads a column the derived table does not select

Trust: Source-defined

user_agent reads ${TABLE}.useragent, but the derived SQL never selects useragent. The field is hidden, which hides the error too.

What goes wrong: Any query that unhides or references user_agent fails with a missing column error.

Read the guide: Missing tables and stale references

Source: activities.view.lookml L147-149
dating_platform/activities.view.lookmlL147-149
  - dimension: structured_event_value    type: number    sql: ${TABLE}.se_value  - dimension: user_agent    sql: ${TABLE}.useragent    hidden: true  - dimension: page_height    type: int    sql: ${TABLE}.doc_height

dating-platform, activities.view.lookml, lines 147-149

Note: Ratios return NULL instead of zero

Trust: Source-defined

Measures such as page_pings_per_session wrap the numerator in NULLIF(..., 0). Sessions with no pings show an empty cell, not 0. Drill sets also reference sessions.*, source.* and domain_session_index, which do not exist here.

Source: activities.view.lookml L218-233
dating_platform/activities.view.lookmlL218-233
    type: count_distinct    sql: ${session_id}    detail: detail*  - measure: page_pings_per_session    type: number    decimals: 2    sql: NULLIF(${page_pings_count},0)/NULLIF(${sessions_count},0)::REAL  - measure: page_pings_per_visitor    type: number    decimals: 2    sql: NULLIF(${page_pings_count},0)/NULLIF(${visitors_count},0)::REAL  - measure: transactions_per_session    type: number    decimals: 3    sql: NULLIF(${transactions_count},0)/NULLIF(${sessions_count},0)::REAL  - measure: transactions_per_visitor    type: number    decimals: 2    sql: NULLIF(${transactions_count},0)/NULLIF(${visitors_count},0)::REAL  - measure: visitors_count    type: count_distinct    sql: ${user_id}

dating-platform, activities.view.lookml, lines 218-233

Parser checks 4

Trust: Source-defined

Mechanical findings from parsing the LookML. They are facts about the files. The cards above explain which ones matter.

Show all 4 checks
  • name-collision 1
    • activities.view.lookml:64 events.timestamp is declared as both dimension and dimension_group.
  • set-missing 1
    • activities.view.lookml:214 events.sessions_count drills into set "detail", which is not declared.
  • set-member-missing 2
    • activities.view.lookml:296 Set events.visit_detail lists "domain_session_index", which is not a field or set in this view.
    • activities.view.lookml:322 Set events.transaction_detail lists "domain_session_index", which is not a field or set in this view.

Related

Guides built on this file

Related source files

Source model