diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7afe25f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,20 @@ +name: release + +on: + workflow_dispatch: + push: + branches: + - master + +# Cancels an release workflows in progress +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +jobs: + release: + permissions: + contents: write + pull-requests: write + uses: looker-open-source/reusable-actions/.github/workflows/marketplace-block-release.yml@main + secrets: inherit diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b9d89fe --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,5 @@ +THIS PROJECT DOES NOT ACCEPT PATCHES OR CONTRIBUTIONS. + +Please contribute to our other projects like [looker-open-source/sdk-codegen](https://github.com/looker-open-source/sdk-codegen). + +This project follows [Google's Open Source Community Guidelines](https://opensource.google/conduct/). diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..02164b6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Google + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a359857 --- /dev/null +++ b/README.md @@ -0,0 +1,323 @@ +# Google Analytics 4 + +## What does this Looker Block do for me? + +This block allows GA4 users to continue to view the dashboards and metrics that they are familiar with from GA360. +In order to mirror a lot of the high level dashboards you see in your existing GA 360 UI by looking at an Overview, Behavior, Audiences, Acquisition, and Custom Goal Conversions, this block creates: + +- An Incremental Persistent Derived Table that Sessionizes the Event Data (Sessions.view) +- Event Level Data linked to a specific Session (events.view + extended views) +- Retention Cohort Analysis capabilities (audience_cohorts.view) +- Looker dimension for every combination of \_event\_name\_ / \_event\_params.key\_ and \_user_properties_ (event\_data\_dimensions folder) for the automatically collected data. +- A Propensity Model written in BigQuery ML for getting predictive analytics on your customers. + + +GA4 data is exported in the format of a single flat table with a new entry for each event +This is is similar to Google's Firebase output and can be difficult to query due to date-based partitioned tables and a need for unnesting in all but the most high-level queries. + +Documentation for getting GA4 data into BigQuery can be found on the Google Analytics support site [here](https://support.google.com/analytics/answer/9823238?hl=en#zippy=%2Cin-this-article) + +# GA4 Data Structure +The GA4 (Google Analytics 4) data is exported as date-partitioned tables consisting of event-level rows. + +For anyone moving to GA4 from GA360, this represents a shift in scope. GA360 exported data had rows unique to a session, with nested information about individual hits (or events). + +Each row in the event tables is a record of one event. There are several standard columns: event_date, event_timestamp, event_name, user_pseudo_id, for a full list of fields exported by default, see https://support.google.com/firebase/answer/7029846. In addition to single-value fields, there are nested fields as well. + +The simpler nested fields can be referenced with dot-notation sql definitions, as shown in this example of the “ECommerce Purchase Revenue” dimension: +```` + dimension: ecommerce__purchase_revenue { + type: number + sql: ${TABLE}.ecommerce.purchase_revenue ;; + group_label: "Ecommerce" + group_item_label: "Purchase Revenue" + value_format_name: usd + } +```` +Here, “purchase_revenue” is an element of the ecommerce field. + +However, Some elements within GA4 are packaged as repeating key/value pairs such as the “event_params” field: + +```` +`event_params:[ + { + "value": { + "string_value": "https://www.google.com/" + }, + "key": "page_location" + }, + { + "value": { + "string_value": "Google" + }, + "key": "page_title" + }, + { + "value": { + "int_value": "1" + }, + "key": "ga_session_number" + }, + { + "value": { + "int_value": "1234567890" + }, + "key": "ga_session_id" + } +]` +```` +The structure for each element in this array is essentially: + +KEY +- KEY_VALUE + +VALUE +- INT_VALUE +- DOUBLE_VALUE +- FLOAT_VALUE +- STRING_VALUE + +As shown above, there are multiple “key” possibilities as well as multiple “value” possibilities within each key. We will also explain the relationship between these nested fields and their LookML views/dimensions below. + +Many desired metrics will be focused on session-level behavior. To facilitate this, sessions need to be identified across multiple rows. + +# Sessionization +The core component of the GA4 Block is the sessions.view file. This file contains the derived table that groups the event rows into session rows. This is started by identifying and isolating the session-level key (referred to throughout the block as “sl_key”). The four components of this sl_key are: + +**Session Date** +The session date is extracted directly from the table name, using the BigQuery “_TABLE_SUFFIX” function which becomes available when the table source for the query includes a wildcard. (For example: select * from events_* would query across all tables that begin with “events_”. In this scenario, you can also select all or portions of the table name to be displayed in the results as a populated column). Because of this, sessions in which events span multiple days will be counted as one session in each day. This is an inherited behavior from existing processes: If a session crosses a day boundary (e.g. if it starts at 11:55 pm and ends at 12:05 am), it is considered a single session, though it is counted once for each day. (https://support.google.com/analytics/answer/9191807) + +**GA Session ID** +This session identifier is used in conjunction with the user ID (user_pseudo_id by default) and the GA Session Number to uniquely identify a session. The GA Session ID by itself may not be unique. + +**GA Session Number** +This number indicates the session frequency of a particular user. Each user’s first visit will be 1.. + +**User Pseudo ID** +This is the default User Identification value populated in GA4. + +This ‘sl_key’, along with its components and all columns from the source event row, are grouped within a CTE titled “session_list_with_event_history” alongside several calculations: + +**Event Rank** +This is a rank function (no duplicate values) ordered by event_timestamp. Each event will have a rank > 0. + +**Time To Next Event** +This is a timestamp_difference function between the event_timestamp of the following event and the event_timestamp of the current event. + +**Page View Rank** +This is a rank function exclusively of ‘page_view’ events ordered by event_timestamp. Each ‘page_view’ event will have a rank > 0. Non ‘page_view’ events will have a rank of 0. + +**Page View Reverse Rank** +Similar to the Page View Rank, however ordered by descending event_timestamp. + +**Time To Next Page** +This timestamp_difference function will only get elapsed time between the present ‘page_view’ event and the following ‘page_view’ event. If a session only has one ‘page_view’ event, this value will be 0. + +The results of the “session_list_with_event_history” CTE are then utilized for the following processes: + +**“Session_facts” CTE:** +- Session Event Count - A count of all events in a given session (grouped by sl_key). +- Session Page View Count - A count of all “page_view” events in a given session (grouped by sl_key). +- Engaged Events - A count of all events identified as ‘Engaged’, an event_parameter (grouped by sl_key). +- Is Engaged Session? - A boolean (yes/no) value indicating if the session contained one or more events with a ‘session_engaged’ positive value (grouped by sl_key). +- Is First Visit Session? - A boolean (yes/no) value indicating if the session contains a ‘first_visit’ event, indicative of a first visit session. +- Session Length Minutes - A timestamp_difference function between the first event_timestamp in a session and the last event_timestamp in a session. Sessions with a singular event_timestamp (even with multiple events) will have a value of 0. + +**“Session Tags” CTE:** +The purpose of this CTE is to extract session-specific tags for Medium, Source, Campaign, and Page Referrer values. These values follow the “Last Non-Direct Click” method of attribution. For the purposes of this block, the “traffic_source” column present in the source event tables was not used. The “traffic_source” values are set on a user’s initial visit to a site or application, and these values can persist beyond the scope of a single session. +- Medium +- Source +- Campaign +- Page Referrer + +**“DeviceGeo” CTE:** +The device and geographic metadata of a session are being extracted from the “session_start” event. + +**“Session Event Packing” CTE:** +This process takes the original row output of “session_list_with_event_history” and condenses it into one row per session, with all the event history of the session nested into an array. This is used later for efficient unnesting of elements without needing to re-group events into sessions at the time of the query. The output is the sl_key, its components, and a nested field called “event_data”. + +The final select statement in this derived table combines the elements of each process into one row for each session that contains: +- SL_KEY +- Session Date +- GA Session ID +- GA Session Number +- User Pseudo ID +- Session Attribution - Nested Element with output of “session_tags”. +- Session Data - Nested Element with output of “session_facts”. +- Device Data - Nested Element with Device columns from output of “DeviceGeo”. +- Geo Data - Nested Element with Geo columns from output of “DeviceGeo”. +- Event Data - Array of all event components that make up this session. + +## Incremental Derived Table +The output of this SQL query is stored as an incremental persistent derived table. This allows appending of new rows to an existing table, instead of a complete drop/create with every scheduled run. The key upon which the incremental updates happen is “Session Date”. To accommodate potential delays in full data delivery, the increment_offset is set to 3. This means for each run, up to 3 days of data may be inserted. + +The initial build of this table will generate a SQL query inserting “1=1”, running across all event tables present in the target dataset. Subsequent runs will insert appropriate “WHERE” syntax to limit the results to the date range specified by the “increment_offset” value. + +**NOTE**: This process of incrementally storing session-data will effectively duplicate the volume of data being exported by GA4. It is important to be aware of the increase in storage; however, this also increases your ability to perform analytics. + +# Looker Model and Views +File Structure +The components of the GA4 Block are isolated into folders for the file type/purpose. From the top down the folders are: +- Attributes. The files contained within this folder are attributes that may be included in an explore/model file. By default the two attribute types included are: datagroups, formats (custom value format definitions) +- Dashboards. All included LookML dashboards are present within this folder +- Explores. Explores have been separated from the model file for potential re-use/extension/refinement. The only explore included by default is “sessions”. This “sessions” explore is where the attributes defined above are being included, as well as all views utilized. +- Models. The GA4 model file is present here. It includes the sessions explore, the LookML dashboards, and a datagroup specific to this model. +- Views +- - BQML Sub-Folder contains the predictions.view file that creates the BQML propensity model. This view is commented-out by default. (See BQML under Notes) +- - Event Data Dimensions Sub-Folder contains views that are extended or unnested via the “Events” view in the parent folder. +- The remaining files are the primary views not directly related to Events. +- Other. manifest.lkml is present in the root directory, and is where the instance constants are defined. + +## Model File +### Views +**“sessions.view”** +This is the base view of the sessions explore of the GA4 model. While GA4 is event based, the data has been sessionized to mimic the analytics available in GA360. This was done with a SQL derived table, and the majority of dimensions defined are direct references to output of the query. Some fields of note are: + +- Audience Selector. This parameter is used in conjunction with the “Audience Trait” dimension, to dynamically update the content delivered on a report. +- Audience Trait. This dimension populates with content from other referenced dimensions, based on the selected value of the “Audience Selector” parameter. +- Landing/Exit Page. These dimensions sub-select within unnested event_data values to obtain the page_view events with the highest ‘page_view_rank’ and ‘reverse_page_view_rank’ values for each session. +- Session Attribution Channel. This dimension is calculated on values from various session attribution fields, and its definition is based on the default channel groupings defined here https://support.google.com/analytics/answer/9756891. +- Session Data Is Bounce?. “Bounce” is not a value present in the GA4 data. This determination is using session length, as all “single page view” sessions will also have a 0 session duration, fulfilling the requirements of traditional bounce determinations. +- GA4 BQML Fields. These three fields are used when generating the BQML purchase propensity model. By default, the prediction_window_days parameter value is set on the predictions.view file where needed. These fields are commented out by default (See BQML under Notes). + +**“events.view”** +The events view brings together the event level data defined in the various event_data_dimensions views. Additionally event-level dimensions and measures are defined in this view. + +As the event data is a representation of the original source rows from your events_* tables, there are a mixture of single-value fields and simple nested fields, as well as repeating key/value fields available within the unnested event_data fields. The single-value fields and simple nested fields are defined within this “events.view” file. The repeating key/value fields for the event parameters have been defined in “event_data_event_params.view”, and the repeating key/value fields for the user properties have been defined in “event_data_user_properties.view”. Both “event_data_event_params.view” and “event_data_user_properties.view” are extended into events.view. + +The definition for a repeating key/value field uses the following format: +(SELECT value.*value_type* FROM UNNEST(*nested_field*) WHERE key = "*key_value*") + + +Here is an example of LookML used to define a nested dimension. +dimension: event_param_all_data { + group_label: "Event: Parameters" + label: "All Data" + type: number + sql: (SELECT value.double_value FROM UNNEST(event_params) WHERE key = "all_data") ;; +} + +Using this method of sub-selecting allows a single row to return for an event with all event parameters selected in horizontally extending columns. If we were to unnest event_params directly and define the dimensions from the unnested results, there would be multiple rows per event: + +| Row* | Key | String Value | Int Value | Double Value | Float Value | +|------|-----|--------------|------------|-------------|-------------| +| 1 | a | null | null | 1.1 | null | +| 2 | b | abc | null | null | null | +| 3 | c | null | 61 | null | null | + *Row Implied + +This is desired on some data, such as the nested ITEMS records. In the case of ITEMS, each nested record is a unique ITEM from the user's purchase, and expanding these into new rows makes sense for filtering and accurate aggregate measures. However, for the purposes of analysis at the event-level, we want one row with columns representing all of these possible keys. + +**“event_data_event_params.view”** +Each event parameter you enable on GA4 will need to have a new dimension and any applicable measures created. The dimensions included in this block correspond to the list of automatically tracked events listed here https://support.google.com/analytics/answer/9234069?hl=en. + +If you are initiating the block with a large amount of custom event parameters already in place, it may be beneficial to obtain a list of them along with the value types that are populated: + + +Sample Query for obtaining a list of all event parameter keys and their respective values: + + ```` + SELECT ep.key + , case when count(value.string_value) > 0 then true else false end as string_value_populated + , case when count(value.int_value) > 0 then true else false end as int_value_populated + , case when count(value.double_value) > 0 then true else false end as double_value_populated + , case when count(value.float_value) > 0 then true else false end as float_value_populated + FROM \`YOUR\_PROJECT.GA4\_DATASET.events\_\*\` e + , UNNEST(event_params) ep + group by 1 + order by 1 asc + ```` +**“event_data_user_properties.view”** +Similar to the event parameters, user properties are likely to include custom attributes or tags. + +**“goals.view”** +This file is to facilitate the creation of custom cohorts for analysis, based on any data available. It is another view file that is extended into “events.view”, and not directly referenced in the model file. By default, the goals are centered around the event name and the “page” value for that event. It is expected that these default goal points will be customized or expanded on with the addition of custom events and/or event parameters. Instructions on how to add new goals, or new variables to filter on in the goal dashboard, are provided in the view file. + +**“page_data.view”** +Another file that is extended into “events.view”, and not referenced in the model directly. Page Data takes advantage of the ‘page_view_rank’ and ‘reverse_page_view_rank’ fields inserted during the initial CTE of the sessions table. These fields allow for analysis of ‘page_view’ events within a session without the need for another derived table. + +Similar to how the landing and exit pages are obtained at the session-level, we are able to query within the scope of the session from within the unnested element. For example we can obtain the 3rd page view in a session with this dimension: + +```` + dimension: page_path_3 { + view_label: "Page Flow" + group_label: "Page Path" + description: "3rd Page in Session." + type: string + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = 3 + and event_history.event_name = "page_view" limit 1) ;; + } + ```` + +If we look at the sql here, and remove the regular expression elements, this is what is occurring: +The sessions table is linked to the events table on the model on the SL_KEY. +When the UNNEST of event_data as event_history occurs, it happens from the scope of an event already associated with a session, and this unnesting is within the scope of the session (all unnested elements belong to the same SL_KEY). +The page_location value for the event in the session to which the original event belongs, and also has a page_view_rank of 3 is returned. +The process of looking “up” at the parent field, re-unnesting, and returning to the original event allows for horizontal columns of page activity to be returned for a single session. + +This series of sub-selects defines the page flow, relative path, and relative reverse path of ‘page_view’ events. These have been defined up to 9 iterations (9 Path Dimensions, 9 Relative Path Dimensions, 9 Relative Reverse Path Dimensions), but there is no limit. Additional length to the path can be added by adjusting the iteration on the sql definition of the desired field. + +**“event_path.view”** +The event_path.view file is structured similarly to the “page_data.view” file, with an emphasis on event_rank instead of page_view_rank. Functionally the definition of the dimensions are the same, and this view is likewise extended into “events.view” instead of being referenced directly in the model. + +**“page_funnel.view”** +The Page Funnel view is extended into “sessions.view”. The dimensions and measures defined here are purpose-built for use with a Page View Funnel/Flow. The same extraction of pages by rank as was used in “page_data.view” is utilized here, with definitions up to 6 pages present by default. + +The “tag” dimensions are what qualifies subsequent page views for inclusion in the resultset. If you filter for a value on Page 1, any subsequent page views that do not follow a qualifying “Page 1” event will be excluded from the measures defined in this view. This process repeats for all subsequently filtered page ranks (up to 6). This can be seen in the difference between the page_1_tag dimension and page_6_tag: + +```` + dimension: page_1_tag { + ... + sql: case when {% condition page_1_filter %} ${page_1} {% endcondition %} + and ${page_1} is not null then 1 else 0 end ;; } + + dimension: page_6_tag { + ... + sql: case when {% condition page_1_filter %} ${page_1} {% endcondition %} + and {% condition page_2_filter %} ${page_2} {% endcondition %} + and {% condition page_3_filter %} ${page_3} {% endcondition %} + and {% condition page_4_filter %} ${page_4} {% endcondition %} + and {% condition page_5_filter %} ${page_5} {% endcondition %} + and {% condition page_6_filter %} ${page_6} {% endcondition %} + and ${page_1} is not null and ${page_2} is not null and ${page_3} is not null + and ${page_4} is not null and ${page_5} is not null and ${page_6} is not null + then 1 else 0 end ;; } +```` + +**“event_funnel.view”** +The event_funnel view is set up similarly to “page_funnel.view”, and is extended into “sessions.view” instead of being referenced in the model. As with the page_funnel, you can easily add/remove further iterations to the funnel by adding new dimensions with incrementing event_rank references. Due to the nature of the event data populated in GA4, it is possible for several (3 or more) events to fire with the exact same timestamp. For example: When a new user visits a site, they will generate “First Visit”, “Session Start”, and “Page View” events with identical event_timestamps. Due to this, the practicality of this funnel is limited without enhancing the event being pulled to include additional event parameters. Instead of “event_name”, another calculated dimension [such as “Full Event”] could be used, or additional filters to exclude events outside of the scope of the request could be added to increase the utility of this view. + +## Customizations +* Event Parameters +Each Event Parameter you enable on GA4 will need to have a new dimension and any applicable measures created, the dimensions included in this block correspond to the list of automatically tracked events [here] (https://support.google.com/analytics/answer/9234069?hl=en). + +Sample Query for obtaining a list of all event parameter keys and what value they use: +``` + SELECT ep.key + , case when count(value.string_value) > 0 then true else false end as string_value_populated + , case when count(value.int_value) > 0 then true else false end as int_value_populated + , case when count(value.double_value) > 0 then true else false end as double_value_populated + , case when count(value.float_value) > 0 then true else false end as float_value_populated + FROM \`YOUR\_PROJECT.GA4\_DATASET.events\_\*\` e + , UNNEST(event_params) ep + group by 1 + order by 1 asc +``` + +* Goals +The Custom Goal Conversions by default are only focused on Event Type and Page Name. Typically the goals would include fields that are populated in instance-specific event parameters. To enable new goal filters, please see the goals.view file for guidance. + +## Notes and Other Known Issues + +* The initial run of the Incremental Persistent Derived Table will execute with a where clause of "WHERE 1=1". This will query all historical data in your GA4 Dataset across all date-partitioned tables. If you do not wish to have all historical data, you can add a hard date filter to the where clause within the "session\_list\_with\_event\_history" cte on sessions.view's derived table definition. +* If you are utilizing user\_id instead of user\_pseudo\_id, you will need to replace references to the user\_pseudo\_id with user\_id in the derived key ("sl\_key") definition in sessions.view's derived table definition, and in the user-centric measure definitions. +* BQML Customer Purchase Propensity Score: This block includes a demonstration of utilizing GA4 data to train a BQML customer purchase propensity score. To ease implementation costs, this has been commented-out by default. To implement this feature, uncomment the BQML View Files and BQML Fields on the sessions.view file. +* For GA360 Users migrating to GA4: Not all fields are the same as in the UI due to GA4's integration of mobile apps. The Incremental Persistent Derived Table will help you navigate through the fields you are already familiarized with. + +## Coming Soon +1. Leverage advanced analytics to be able to predict which customers are likely to make another purchase in the future based off of their historical actions. +2. Better understand your customers by looking at their natural pathing through pages and events through your pages alongside the ability to create completely custom page and event paths to conduct any A/B testing to see how customers are trending. +3. You can look at the successes of your marketing campaigns as well by using the campaign impact dashboard to identify a specific cohort of customers you targeted with a campaign and seeing how that particular customer base has trended over time to see if the campaign had any effect. +4. Looker will offer an out of the box data action to enable you to push data back into your GA console. diff --git a/attributes/.gitkeep b/attributes/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/attributes/datagroups.lkml b/attributes/datagroups.lkml new file mode 100644 index 0000000..ad0f05b --- /dev/null +++ b/attributes/datagroups.lkml @@ -0,0 +1,8 @@ +datagroup: bqml_datagroup { + #retrain model every week + sql_trigger: SELECT EXTRACT(week from CURRENT_DATE()) ;; +} +datagroup: attribution_channel{ + # re builds dummy tables for channel acquisition + sql_trigger: SELECT EXTRACT(month from CURRENT_DATE()) ;; +} diff --git a/attributes/formats.lkml b/attributes/formats.lkml new file mode 100644 index 0000000..8179727 --- /dev/null +++ b/attributes/formats.lkml @@ -0,0 +1,7 @@ +named_value_format: hour_format { + value_format: "[h]:mm:ss" +} + +named_value_format: formatted_number { + value_format:"[<1000]0;[<1000000]0.0,\"K\";0.0,,\"M\"" +} diff --git a/dashboards/.gitkeep b/dashboards/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/dashboards/acquisition.dashboard.lookml b/dashboards/acquisition.dashboard.lookml new file mode 100644 index 0000000..be3b983 --- /dev/null +++ b/dashboards/acquisition.dashboard.lookml @@ -0,0 +1,978 @@ +- dashboard: acquisition + title: "[GA4] Acquisition" + layout: newspaper + preferred_viewer: dashboards-next + elements: + - name: '' + type: text + title_text: '' + subtitle_text: '' + body_text: "---\n
\n\t
\n\t\t

Acquisition Overview

Use\ + \ Audience Cohort filter to change what field the data is grouped by for the\ + \ Overview metrics

\n
" + row: 4 + col: 0 + width: 24 + height: 4 + - title: Sessions + name: Sessions + model: ga4 + explore: sessions + type: single_value + fields: [sessions.total_sessions, sessions.total_first_visit_sessions_percentage] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + color_application: + collection_id: legacy + palette_id: looker_classic + custom_color: "#FFF" + single_value_title: Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + note_state: collapsed + note_display: hover + note_text: Sessions based on filters + listen: + Audience Cohort [Required]: sessions.audience_selector + Date: sessions.session_date + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + row: 8 + col: 0 + width: 8 + height: 3 + - title: Users + name: Users + model: ga4 + explore: sessions + type: single_value + fields: [sessions.total_users] + sorts: [sessions.total_users desc] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + options: + steps: 5 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + series_types: {} + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + custom_color: "#FFF" + single_value_title: Total Users + comparison_label: Returning Users + conditional_formatting: [{type: not null, value: !!null '', background_color: "#1A73E8", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + listen: + Audience Cohort [Required]: sessions.audience_selector + Date: sessions.session_date + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + row: 8 + col: 8 + width: 8 + height: 3 + - title: Page Views + name: Page Views + model: ga4 + explore: sessions + type: single_value + fields: [events.total_page_views] + sorts: [events.total_page_views desc] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + series_types: {} + point_style: none + series_colors: + events.total_page_views: "#EA4335" + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + custom_color: "#FFF" + comparison_label: Unique Page Views + conditional_formatting: [{type: not null, value: !!null '', background_color: "#c73727", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: [] + y_axes: [] + listen: + Audience Cohort [Required]: sessions.audience_selector + Date: sessions.session_date + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + row: 8 + col: 16 + width: 8 + height: 3 + - title: Sessions by Cohort + name: Sessions by Cohort + model: ga4 + explore: sessions + type: looker_bar + fields: [sessions.total_sessions, sessions.audience_trait] + sorts: [sessions.total_sessions desc] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: true + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + options: + steps: 5 + limit_displayed_rows_values: + show_hide: show + first_last: first + num_rows: '10' + series_types: {} + series_colors: + sessions.total_sessions: "#F9AB00" + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + single_value_title: Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + note_state: collapsed + note_display: hover + note_text: Sessions based on filters + listen: + Audience Cohort [Required]: sessions.audience_selector + Date: sessions.session_date + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + row: 11 + col: 0 + width: 8 + height: 10 + - title: Users by Cohort + name: Users by Cohort + model: ga4 + explore: sessions + type: looker_bar + fields: [sessions.total_users, sessions.audience_trait] + sorts: [sessions.total_users desc] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + options: + steps: 5 + series_types: {} + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + single_value_title: Total Users + comparison_label: Returning Users + conditional_formatting: [{type: not null, value: !!null '', background_color: "#1A73E8", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + listen: + Audience Cohort [Required]: sessions.audience_selector + Date: sessions.session_date + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + row: 11 + col: 8 + width: 8 + height: 10 + - title: Page Views by Cohort + name: Page Views by Cohort + model: ga4 + explore: sessions + type: looker_bar + fields: [events.total_page_views, sessions.audience_trait] + sorts: [events.total_page_views desc] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + series_types: {} + series_colors: + events.total_page_views: "#EA4335" + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + comparison_label: Unique Page Views + conditional_formatting: [{type: not null, value: !!null '', background_color: "#c73727", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: [] + y_axes: [] + listen: + Audience Cohort [Required]: sessions.audience_selector + Date: sessions.session_date + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + row: 11 + col: 16 + width: 8 + height: 10 + - title: Session Breakdown + name: Session Breakdown + model: ga4 + explore: sessions + type: looker_bar + fields: [sessions.audience_trait, sessions.total_sessions, audience_cohorts.rank] + pivots: [sessions.audience_trait, audience_cohorts.rank] + sorts: [audience_cohorts.rank, sessions.audience_trait] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: percent + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + series_types: {} + defaults_version: 1 + listen: + Audience Cohort [Required]: sessions.audience_selector + Date: sessions.session_date + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + row: 21 + col: 0 + width: 24 + height: 7 + - title: Session by Week + name: Session by Week + model: ga4 + explore: sessions + type: looker_column + fields: [sessions.audience_trait, sessions.total_sessions, audience_cohorts.rank, + sessions.session_week] + pivots: [sessions.audience_trait, audience_cohorts.rank] + fill_fields: [sessions.session_week] + sorts: [audience_cohorts.rank, sessions.audience_trait, sessions.session_week + desc] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: percent + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + series_types: {} + defaults_version: 1 + listen: + Audience Cohort [Required]: sessions.audience_selector + Date: sessions.session_date + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + row: 28 + col: 0 + width: 24 + height: 10 + - title: Engagement + name: Engagement + model: ga4 + explore: sessions + type: looker_grid + fields: [sessions.total_sessions, sessions.audience_trait, sessions.total_first_visit_sessions_percentage, + sessions.total_bounced_sessions_percentage, sessions.average_page_views_per_session, + sessions.average_session_duration] + sorts: [sessions.total_sessions desc] + limit: 500 + column_limit: 50 + total: true + show_view_names: false + show_row_numbers: true + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: true + enable_conditional_formatting: false + header_text_alignment: left + header_font_size: '20' + rows_font_size: '20' + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + show_sql_query_menu_options: false + show_totals: true + show_row_totals: true + series_labels: + sessions.audience_trait: Cohort + sessions.total_first_visit_sessions_percentage: "% New Sessions" + sessions.total_bounced_sessions_percentage: Bounce Rate + sessions.average_page_views_per_session: Pages / Session + sessions.average_session_duration: Avg. Session Duration + series_column_widths: + sessions.audience_trait: 252 + series_cell_visualizations: + sessions.total_first_visit_sessions_percentage: + is_active: true + sessions.total_bounced_sessions_percentage: + is_active: true + sessions.average_page_views_per_session: + is_active: true + sessions.average_session_duration: + is_active: true + limit_displayed_rows_values: + show_hide: show + first_last: first + num_rows: '50' + header_background_color: "#F9AB00" + series_value_format: + sessions.total_bounced_sessions_percentage: + name: percent_0 + decimals: '0' + format_string: "#,##0%" + label: Percent (0) + label_prefix: Percent + sessions.total_first_visit_sessions_percentage: + name: percent_0 + decimals: '0' + format_string: "#,##0%" + label: Percent (0) + label_prefix: Percent + sessions.average_page_views_per_session: + name: decimal_2 + decimals: '2' + format_string: "#,##0.00" + label: Decimals (2) + label_prefix: Decimals + x_axis_gridlines: false + y_axis_gridlines: true + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: percent + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + series_types: {} + defaults_version: 1 + hidden_fields: [sessions.total_sessions] + note_state: collapsed + note_display: hover + note_text: Engagement metrics by Audience Trait (based on Audience Cohort filter). + Sorted by trait with highest traffic (i.e. Sessions). + listen: + Audience Cohort [Required]: sessions.audience_selector + Date: sessions.session_date + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + row: 38 + col: 0 + width: 24 + height: 11 + - name: " (2)" + type: text + title_text: '' + subtitle_text: '' + body_text: "---\n
\n\t
\n\t\t

Acquisition Detail

Audience\ + \ Cohort filter does not affect any tiles below this point

\n
" + row: 49 + col: 0 + width: 24 + height: 4 + - title: Top Referrers + name: Top Referrers + model: ga4 + explore: sessions + type: looker_bar + fields: [sessions.session_attribution_source, sessions.total_sessions] + filters: {} + sorts: [sessions.total_sessions desc] + limit: 500 + column_limit: 50 + dynamic_fields: [{table_calculation: of_total, label: "% of Total", expression: "${sessions.total_sessions}/sum(${sessions.total_sessions})", + value_format: !!null '', value_format_name: percent_0, _kind_hint: measure, + _type_hint: number}] + x_axis_gridlines: false + y_axis_gridlines: false + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: true + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + limit_displayed_rows_values: + show_hide: show + first_last: first + num_rows: '10' + hidden_series: [of_total] + series_types: {} + series_colors: + sessions.total_sessions: "#F9AB00" + of_total: "#facb04" + defaults_version: 1 + listen: + Date: sessions.session_date + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + row: 53 + col: 0 + width: 12 + height: 10 + - title: Top Landing Page + name: Top Landing Page + model: ga4 + explore: sessions + type: looker_bar + fields: [sessions.total_sessions, events.event_param_page] + filters: + events.event_param_page: "-EMPTY" + events.is_landing_page: 'Yes' + sorts: [sessions.total_sessions desc] + limit: 500 + column_limit: 50 + dynamic_fields: [{table_calculation: of_total, label: "% of Total", expression: "${sessions.total_sessions}/sum(${sessions.total_sessions})", + value_format: !!null '', value_format_name: percent_0, _kind_hint: measure, + _type_hint: number}] + x_axis_gridlines: false + y_axis_gridlines: false + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: true + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + limit_displayed_rows_values: + show_hide: show + first_last: first + num_rows: '10' + hidden_series: [of_total] + series_types: {} + series_colors: + sessions.total_sessions: "#F9AB00" + of_total: "#facb04" + defaults_version: 1 + hidden_fields: [] + y_axes: [] + listen: + Date: sessions.session_date + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + row: 53 + col: 12 + width: 12 + height: 10 + - name: " (3)" + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t
\n\t\t\n\t

\n\n
" + row: 0 + col: 0 + width: 24 + height: 4 + filters: + - name: Date + title: Date + type: field_filter + default_value: 14 day + allow_multiple_values: true + required: false + ui_config: + type: relative_timeframes + display: inline + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.session_date + - name: Audience Cohort [Required] + title: Audience Cohort [Required] + type: field_filter + default_value: Channel + allow_multiple_values: true + required: true + ui_config: + type: dropdown_menu + display: inline + options: + - Channel + - Medium + - Source + - Source Medium + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.audience_selector + - name: Country [Optional] + title: Country [Optional] + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.geo_data_country + - name: Continent [Optional] + title: Continent [Optional] + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: checkboxes + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.geo_data_continent + - name: Source [Optional] + title: Source [Optional] + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.session_attribution_source + - name: Source / Medium [Optional] + title: Source / Medium [Optional] + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.session_attribution_source_medium + - name: Medium [Optional] + title: Medium [Optional] + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.session_attribution_medium + - name: Channel [Optional] + title: Channel [Optional] + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: checkboxes + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: attribution_sources.attribution_source_channel \ No newline at end of file diff --git a/dashboards/arima.dashboard.lookml b/dashboards/arima.dashboard.lookml new file mode 100644 index 0000000..773a72e --- /dev/null +++ b/dashboards/arima.dashboard.lookml @@ -0,0 +1,563 @@ +--- +- dashboard: arima + title: "[GA4] ARIMA Model" + layout: newspaper + preferred_viewer: dashboards-next + description: '' + preferred_slug: Earwwr3dvZ4OQPQZzyBlDn + elements: + - name: " box" + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t
\n\t\t\n\t

\n\n
" + row: 0 + col: 0 + width: 24 + height: 4 + + - name: " (4)" + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t
\n\n
" + row: 0 + col: 0 + width: 20 + height: 2 + + + + + - name: ARIMA Model + title: ARIMA Model + merged_queries: + - model: ga4 + explore: sessions + type: looker_line + fields: [forecasting.forecast_timestamp, forecasting.prediction_interval_lower_bound, + forecasting.forecast_value, forecasting.prediction_interval_upper_bound] + fill_fields: [forecasting.forecast_timestamp] + filters: + forecasting.events_event_name: '' + sorts: [forecasting.forecast_timestamp desc] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + show_null_points: true + interpolation: linear + hidden_pivots: {} + show_row_numbers: true + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + enable_conditional_formatting: false + header_text_alignment: left + header_font_size: 12 + rows_font_size: 12 + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + defaults_version: 1 + join_fields: [] + - model: ga4 + explore: sessions + type: looker_line + fields: [sum_of_session_event_count, events.event_time_date, sessions.total_sessions] + fill_fields: [events.event_time_date] + filters: + events.event_name: '' + sorts: [events.event_time_date desc] + limit: 500 + column_limit: 50 + dynamic_fields: + - measure: sum_of_session_event_count + based_on: sessions.session_data_session_event_count + expression: '' + label: Sum of Session Event Count + type: sum + _kind_hint: measure + _type_hint: number + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + show_null_points: true + interpolation: linear + x_axis_zoom: true + y_axis_zoom: true + swap_axes: false + hidden_pivots: {} + show_row_numbers: true + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + enable_conditional_formatting: false + header_text_alignment: left + header_font_size: 12 + rows_font_size: 12 + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + defaults_version: 1 + hidden_fields: [sum_of_session_event_count] + join_fields: + - field_name: events.event_time_date + source_field_name: forecasting.forecast_timestamp + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + y_axes: [{label: '', orientation: left, series: [{axisId: sessions.total_sessions, + id: sessions.total_sessions, name: Sessions}, {axisId: forecasting.prediction_interval_lower_bound, + id: forecasting.prediction_interval_lower_bound, name: Prediction Interval + Lower Bound}, {axisId: forecasting.forecast_value, id: forecasting.forecast_value, + name: Forecast Value}, {axisId: forecasting.prediction_interval_upper_bound, + id: forecasting.prediction_interval_upper_bound, name: Prediction Interval + Upper Bound}], showLabels: true, showValues: true, maxValue: 200, unpinAxis: false, + tickDensity: default, type: linear}] + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + x_axis_zoom: true + y_axis_zoom: true + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + series_types: + forecasting.prediction_interval_upper_bound: area + forecasting.prediction_interval_lower_bound: area + point_style: none + series_colors: + forecasting.forecast_value: "#1A73E8" + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + show_null_points: false + interpolation: linear + type: looker_line + hidden_fields: [sum_of_session_event_count, forecasting.forecast_value, sessions.total_sessions] + dynamic_fields: + - category: table_calculation + expression: case(when(is_null(${sessions.total_sessions}),${forecasting.forecast_value}),${sessions.total_sessions}) + label: Real value and forecasted value + value_format: + value_format_name: + _kind_hint: measure + table_calculation: real_value_and_forecasted_value + _type_hint: number + listen: + - Event Name: forecasting.events_event_name + - Event Name: events.event_name + row: 6 + col: 0 + width: 24 + height: 8 + - title: Model Evaluation + name: Model Evaluation + model: ga4 + explore: model_evaluation + type: looker_grid + fields: [model_evaluation.events_event_name, model_evaluation.AIC, model_evaluation.log_likelihood, + model_evaluation.non_seasonal_p, model_evaluation.non_seasonal_d, model_evaluation.non_seasonal_q, + model_evaluation.has_drift] + sorts: [model_evaluation.events_event_name] + limit: 500 + column_limit: 50 + show_view_names: false + show_row_numbers: false + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: false + enable_conditional_formatting: false + header_text_alignment: left + header_font_size: '12' + rows_font_size: '12' + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + show_sql_query_menu_options: false + show_totals: true + show_row_totals: true + truncate_header: false + minimum_column_width: 75 + defaults_version: 1 + listen: + Event Name: model_evaluation.events_event_name + row: 17 + col: 0 + width: 24 + height: 3 + - title: AR + name: AR + model: ga4 + explore: model_evaluation + type: single_value + fields: [model_evaluation.non_seasonal_p] + sorts: [model_evaluation.non_seasonal_p] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + single_value_title: AR Steps + conditional_formatting: [{type: not null, value: !!null '', background_color: "#E8710A", + font_color: "#ffff", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + show_view_names: false + show_row_numbers: true + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: false + header_text_alignment: left + header_font_size: 12 + rows_font_size: 12 + defaults_version: 1 + listen: + Event Name: model_evaluation.events_event_name + row: 20 + col: 0 + width: 8 + height: 4 + - title: Integrated + name: Integrated + model: ga4 + explore: model_evaluation + type: single_value + fields: [model_evaluation.non_seasonal_d] + filters: {} + sorts: [model_evaluation.non_seasonal_d] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + single_value_title: Integrated value + conditional_formatting: [{type: not null, value: !!null '', background_color: "#12B5CB", + font_color: "#ffff", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + show_view_names: false + show_row_numbers: true + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: false + header_text_alignment: left + header_font_size: 12 + rows_font_size: 12 + defaults_version: 1 + listen: + Event Name: model_evaluation.events_event_name + row: 20 + col: 8 + width: 8 + height: 4 + - title: Moving Averages + name: Moving Averages + model: ga4 + explore: model_evaluation + type: single_value + fields: [model_evaluation.non_seasonal_q] + filters: {} + sorts: [model_evaluation.non_seasonal_q] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + single_value_title: Moving Averages + conditional_formatting: [{type: not null, value: !!null '', background_color: "#A8A116", + font_color: "#fff", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + show_view_names: false + show_row_numbers: true + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: false + header_text_alignment: left + header_font_size: 12 + rows_font_size: 12 + defaults_version: 1 + listen: + Event Name: model_evaluation.events_event_name + row: 20 + col: 16 + width: 8 + height: 4 + - title: Lower Bound + name: Lower Bound + model: ga4 + explore: sessions + type: single_value + fields: [forecasting.forecast_timestamp, forecasting.forecast_value, forecasting.prediction_interval_lower_bound, + forecasting.prediction_interval_upper_bound] + fill_fields: [forecasting.forecast_timestamp] + filters: {} + sorts: [forecasting.forecast_timestamp desc] + limit: 1 + column_limit: 50 + filter_expression: "${forecasting.forecast_timestamp}<=add_days(1,now())" + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + single_value_title: Lower Bound + value_format: '0.00' + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#ffffff", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + show_view_names: false + defaults_version: 1 + hidden_fields: [forecasting.forecast_value] + listen: + Event Name: forecasting.events_event_name + row: 0 + col: 0 + width: 8 + height: 6 + - name: '' + type: text + title_text: '' + subtitle_text: '' + body_text: | + *** + + # Model Evaluation + row: 14 + col: 0 + width: 24 + height: 3 + - title: Users Expected Tomorrow (Copy) + name: Users Expected Tomorrow (Copy) + model: ga4 + explore: sessions + type: single_value + fields: [forecasting.forecast_timestamp, forecasting.forecast_value, forecasting.prediction_interval_lower_bound, + forecasting.prediction_interval_upper_bound] + fill_fields: [forecasting.forecast_timestamp] + filters: {} + sorts: [forecasting.forecast_timestamp desc] + limit: 1 + column_limit: 50 + filter_expression: "${forecasting.forecast_timestamp}<=add_days(1,now())" + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + single_value_title: Users Expected Tomorrow + value_format: '0.00' + conditional_formatting: [{type: not null, value: !!null '', background_color: "#1A73E8", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + show_view_names: false + defaults_version: 1 + listen: + Event Name: forecasting.events_event_name + row: 0 + col: 8 + width: 8 + height: 6 + - title: Upper Bound + name: Upper Bound + model: ga4 + explore: sessions + type: single_value + fields: [forecasting.forecast_timestamp, forecasting.forecast_value, forecasting.prediction_interval_lower_bound, + forecasting.prediction_interval_upper_bound] + fill_fields: [forecasting.forecast_timestamp] + filters: {} + sorts: [forecasting.forecast_timestamp desc] + limit: 1 + column_limit: 50 + filter_expression: "${forecasting.forecast_timestamp}<=add_days(1,now())" + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + single_value_title: Upper Bound + value_format: '0.00' + conditional_formatting: [{type: not null, value: !!null '', background_color: "#EA4335", + font_color: "#ffffff", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + show_view_names: false + defaults_version: 1 + hidden_fields: [forecasting.forecast_value, forecasting.prediction_interval_lower_bound] + listen: + Event Name: forecasting.events_event_name + row: 0 + col: 16 + width: 8 + height: 6 + filters: + - name: Event Name + title: Event Name + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + model: ga4 + explore: sessions + listens_to_filters: [] + field: events.event_name \ No newline at end of file diff --git a/dashboards/audience.dashboard.lookml b/dashboards/audience.dashboard.lookml new file mode 100644 index 0000000..bd33a48 --- /dev/null +++ b/dashboards/audience.dashboard.lookml @@ -0,0 +1,1719 @@ +- dashboard: audience + title: "[GA4] Audience" + layout: newspaper + preferred_viewer: dashboards-next + elements: + - name: '' + type: text + title_text: '' + subtitle_text: '' + body_text: "---\n
\n\t
\n\t\t

Audience Overview

\n Use\ + \ Audience Cohort filter to change what field the data is grouped by for the\ + \ Overview metrics

\n
" + row: 4 + col: 0 + width: 24 + height: 4 + - title: Sessions + name: Sessions + model: ga4 + explore: sessions + type: single_value + fields: [sessions.total_sessions, sessions.total_first_visit_sessions_percentage] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + color_application: + collection_id: legacy + palette_id: looker_classic + custom_color: "#FFF" + single_value_title: Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + note_state: collapsed + note_display: hover + note_text: Sessions based on filters + listen: + Audience Cohort [Required]: sessions.audience_selector + Date: sessions.session_date + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + row: 8 + col: 0 + width: 8 + height: 3 + - title: Users + name: Users + model: ga4 + explore: sessions + type: single_value + fields: [sessions.total_users] + sorts: [sessions.total_users desc] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + options: + steps: 5 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + series_types: {} + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + custom_color: "#FFF" + single_value_title: Total Users + comparison_label: Returning Users + conditional_formatting: [{type: not null, value: !!null '', background_color: "#1A73E8", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + listen: + Audience Cohort [Required]: sessions.audience_selector + Date: sessions.session_date + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + row: 8 + col: 8 + width: 8 + height: 3 + - title: Page Views + name: Page Views + model: ga4 + explore: sessions + type: single_value + fields: [events.total_page_views] + sorts: [events.total_page_views desc] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + series_types: {} + point_style: none + series_colors: + events.total_page_views: "#EA4335" + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + custom_color: "#FFF" + comparison_label: Unique Page Views + conditional_formatting: [{type: not null, value: !!null '', background_color: "#c73727", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: [] + y_axes: [] + listen: + Audience Cohort [Required]: sessions.audience_selector + Date: sessions.session_date + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + row: 8 + col: 16 + width: 8 + height: 3 + - title: Sessions by Cohort + name: Sessions by Cohort + model: ga4 + explore: sessions + type: looker_bar + fields: [sessions.total_sessions, sessions.audience_trait] + sorts: [sessions.total_sessions desc] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: true + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + options: + steps: 5 + limit_displayed_rows_values: + show_hide: show + first_last: first + num_rows: '10' + series_types: {} + series_colors: + sessions.total_sessions: "#F9AB00" + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + single_value_title: Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + note_state: collapsed + note_display: hover + note_text: Sessions based on filters + listen: + Audience Cohort [Required]: sessions.audience_selector + Date: sessions.session_date + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + row: 11 + col: 0 + width: 8 + height: 10 + - title: Users by Cohort + name: Users by Cohort + model: ga4 + explore: sessions + type: looker_bar + fields: [sessions.total_users, sessions.audience_trait] + sorts: [sessions.total_users desc] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + options: + steps: 5 + series_types: {} + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + single_value_title: Total Users + comparison_label: Returning Users + conditional_formatting: [{type: not null, value: !!null '', background_color: "#1A73E8", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + listen: + Audience Cohort [Required]: sessions.audience_selector + Date: sessions.session_date + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + row: 11 + col: 8 + width: 8 + height: 10 + - title: Page Views by Cohort + name: Page Views by Cohort + model: ga4 + explore: sessions + type: looker_bar + fields: [events.total_page_views, sessions.audience_trait] + sorts: [events.total_page_views desc] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + series_types: {} + series_colors: + events.total_page_views: "#EA4335" + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + comparison_label: Unique Page Views + conditional_formatting: [{type: not null, value: !!null '', background_color: "#c73727", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: [] + y_axes: [] + listen: + Audience Cohort [Required]: sessions.audience_selector + Date: sessions.session_date + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + row: 11 + col: 16 + width: 8 + height: 10 + - title: Session Breakdown + name: Session Breakdown + model: ga4 + explore: sessions + type: looker_bar + fields: [sessions.audience_trait, sessions.total_sessions, audience_cohorts.rank] + pivots: [sessions.audience_trait, audience_cohorts.rank] + sorts: [audience_cohorts.rank, sessions.audience_trait] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: percent + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + series_types: {} + defaults_version: 1 + listen: + Audience Cohort [Required]: sessions.audience_selector + Date: sessions.session_date + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + row: 21 + col: 0 + width: 24 + height: 7 + - title: Session by Week + name: Session by Week + model: ga4 + explore: sessions + type: looker_column + fields: [sessions.audience_trait, sessions.total_sessions, audience_cohorts.rank, + sessions.session_week] + pivots: [sessions.audience_trait, audience_cohorts.rank] + fill_fields: [sessions.session_week] + sorts: [audience_cohorts.rank, sessions.audience_trait, sessions.session_week + desc] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: percent + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + series_types: {} + defaults_version: 1 + listen: + Audience Cohort [Required]: sessions.audience_selector + Date: sessions.session_date + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + row: 28 + col: 0 + width: 24 + height: 10 + - name: " (2)" + type: text + title_text: '' + subtitle_text: '' + body_text: "---\n
\n\t
\n\t\t

Audience Behavior

Audience\ + \ Cohort filter does not affect any tiles below this point

\n
" + row: 38 + col: 0 + width: 24 + height: 4 + - title: How many people return? + name: How many people return? + model: ga4 + explore: sessions + type: looker_column + fields: [sessions.total_users, sessions.ga_session_number_tier] + filters: + sessions.ga_session_number_tier: "-Below 1,-Undefined" + sorts: [sessions.ga_session_number_tier] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + custom: + id: 550fbd5a-309c-402e-4038-004b08c05ef0 + label: Custom + type: continuous + stops: + - color: "#1A73E8" + offset: 0 + - color: "#FFF" + offset: 100 + options: + steps: 5 + x_axis_label: Repeat Visits + series_types: {} + show_dropoff: true + leftAxisLabelVisible: false + leftAxisLabel: '' + rightAxisLabelVisible: false + rightAxisLabel: '' + smoothedBars: false + orientation: automatic + labelPosition: left + percentType: total + percentPosition: inline + valuePosition: right + labelColorEnabled: false + labelColor: "#FFF" + defaults_version: 1 + listen: + Date: sessions.session_date + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + row: 42 + col: 0 + width: 12 + height: 11 + - name: " (3)" + type: text + title_text: '' + subtitle_text: '' + body_text: "---\n
\n\t
\n\t\t

Engagement

\n
" + row: 53 + col: 0 + width: 24 + height: 3 + - title: Session Duration Tiers (Seconds) + name: Session Duration Tiers (Seconds) + model: ga4 + explore: sessions + type: looker_column + fields: [sessions.session_data_session_duration_tier, sessions.total_sessions] + filters: + sessions.session_data_session_duration_tier: "-Undefined" + sorts: [sessions.session_data_session_duration_tier] + limit: 500 + column_limit: 50 + dynamic_fields: [{table_calculation: of_total, label: "% of Total", expression: "${sessions.total_sessions}/sum(${sessions.total_sessions})", + value_format: !!null '', value_format_name: percent_0, _kind_hint: measure, + _type_hint: number}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + options: + steps: 5 + y_axes: [{label: '', orientation: left, series: [{axisId: of_total, id: of_total, + name: "% of Total"}], showLabels: false, showValues: true, unpinAxis: false, + tickDensity: default, type: linear}] + hidden_series: [sessions.total_sessions] + series_types: {} + series_colors: + sessions.total_sessions: "#12B5CB" + sessions.average_session_duration: "#1A73E8" + sessions.total_bounced_sessions_percentage: "#12B5CB" + of_total: "#1A73E8" + series_labels: + sessions.total_sessions: Sessions + sessions.total_bounced_sessions_percentage: Bounce Rate + sessions.average_session_duration: Avg Session Duration + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + single_value_title: Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: + listen: + Date: sessions.session_date + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + row: 56 + col: 0 + width: 12 + height: 10 + - title: Days Since Previous Session + name: Days Since Previous Session + model: ga4 + explore: sessions + type: looker_column + fields: [user_previous_session.days_since_previous_session_tier, sessions.total_sessions] + filters: + sessions.session_data_is_first_visit_session: 'No' + user_previous_session.days_since_previous_session_tier: "-Undefined" + sorts: [user_previous_session.days_since_previous_session_tier] + limit: 500 + column_limit: 50 + dynamic_fields: [{table_calculation: of_total, label: "% of Total", expression: "${sessions.total_sessions}/sum(${sessions.total_sessions})", + value_format: !!null '', value_format_name: percent_0, _kind_hint: measure, + _type_hint: number}] + x_axis_gridlines: false + y_axis_gridlines: false + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + y_axes: [{label: '', orientation: left, series: [{axisId: of_total, id: of_total, + name: "% of Total"}], showLabels: false, showValues: false, unpinAxis: false, + tickDensity: default, tickDensityCustom: 5, type: linear}] + defaults_version: 1 + hidden_fields: [sessions.total_sessions] + listen: + Date: sessions.session_date + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + row: 42 + col: 12 + width: 12 + height: 11 + - title: Pages Visited in Session + name: Pages Visited in Session + model: ga4 + explore: sessions + type: looker_column + fields: [sessions.session_data_page_view_count, sessions.total_sessions] + filters: + sessions.session_data_page_view_count: ">0" + sorts: [sessions.session_data_page_view_count] + limit: 500 + column_limit: 50 + dynamic_fields: [{table_calculation: of_total_sessions, label: "% of Total Sessions", + expression: "${sessions.total_sessions}/sum(${sessions.total_sessions})", + value_format: !!null '', value_format_name: percent_0, _kind_hint: measure, + _type_hint: number}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: true + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + y_axes: [{label: '', orientation: left, series: [{axisId: of_total_sessions, id: of_total_sessions, + name: "% of Total Sessions"}], showLabels: false, showValues: false, unpinAxis: false, + tickDensity: default, tickDensityCustom: 5, type: linear}] + limit_displayed_rows_values: + show_hide: show + first_last: first + num_rows: '10' + series_types: {} + hidden_fields: [sessions.total_sessions] + show_null_points: true + defaults_version: 1 + listen: + Date: sessions.session_date + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + row: 56 + col: 12 + width: 12 + height: 10 + - title: When are People Visiting? + name: When are People Visiting? + model: ga4 + explore: sessions + type: looker_grid + fields: [sessions.session_data_session_start_hour_of_day, sessions.total_sessions, + sessions.session_data_session_start_day_of_week] + pivots: [sessions.session_data_session_start_day_of_week] + fill_fields: [sessions.session_data_session_start_hour_of_day] + filters: + sessions.session_data_session_start_day_of_week: "-NULL" + sorts: [sessions.session_data_session_start_day_of_week, sessions.session_data_session_start_hour_of_day] + limit: 500 + column_limit: 50 + total: true + row_total: right + dynamic_fields: [{table_calculation: of_total_sessions, label: "% of Total Sessions", + expression: "${sessions.total_sessions}/sum(${sessions.total_sessions:row_total})", + value_format: !!null '', value_format_name: percent_1, _kind_hint: measure, + _type_hint: number}, {table_calculation: weekly_of_total_sessions, label: Weekly + % of Total Sessions, expression: "${sessions.total_sessions:row_total}/sum(${sessions.total_sessions:row_total})", + value_format: !!null '', value_format_name: percent_1, _kind_hint: supermeasure, + _type_hint: number}] + show_view_names: false + show_row_numbers: false + transpose: false + truncate_text: false + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: false + enable_conditional_formatting: true + header_text_alignment: left + header_font_size: '12' + rows_font_size: '12' + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + show_sql_query_menu_options: false + show_totals: true + show_row_totals: true + series_labels: + weekly_of_total_sessions: Week Total + of_total_sessions: Sessions + sessions.session_data_session_start_hour_of_day: Hour of Day + sessions.session_data_session_start_day_of_week: Day of Week + series_column_widths: + sessions.session_data_session_start_hour_of_day: 133 + conditional_formatting: [{type: along a scale..., value: !!null '', background_color: "#1A73E8", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab, options: {steps: 46, constraints: { + min: {type: minimum}, mid: {type: average}, max: {type: maximum}}, mirror: false, + reverse: false, stepped: false}}, bold: false, italic: false, strikethrough: false, + fields: [of_total_sessions]}, {type: along a scale..., value: !!null '', background_color: "#1A73E8", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab, options: {steps: 5, constraints: { + min: {type: minimum}, mid: {type: average}, max: {type: maximum}}, mirror: false, + reverse: false, stepped: false}}, bold: false, italic: false, strikethrough: false, + fields: [weekly_of_total_sessions]}] + x_axis_gridlines: false + y_axis_gridlines: true + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + show_null_points: true + defaults_version: 1 + series_types: {} + hidden_fields: [sessions.total_sessions] + listen: + Date: sessions.session_date + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + row: 66 + col: 0 + width: 24 + height: 12 + - name: " (4)" + type: text + title_text: '' + subtitle_text: '' + body_text: "---\n
\n\t
\n\t\t

Geo

\n
" + row: 78 + col: 0 + width: 24 + height: 3 + - title: Continents + name: Continents + model: ga4 + explore: sessions + type: looker_bar + fields: [sessions.total_sessions, sessions.geo_data_continent] + pivots: [sessions.geo_data_continent] + filters: + sessions.geo_data_continent: -EMPTY, -NULL, -"(not set)" + sorts: [sessions.total_sessions desc 0, sessions.geo_data_continent] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: false + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: percent + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + map_plot_mode: points + heatmap_gridlines: false + heatmap_gridlines_empty: false + heatmap_opacity: 0.5 + show_region_field: true + draw_map_labels_above_data: true + map_tile_provider: dark + map_position: custom + map_latitude: 36.64253952433933 + map_longitude: -98.10797452926636 + map_zoom: 4 + map_scale_indicator: 'off' + map_pannable: true + map_zoomable: true + map_marker_type: circle + map_marker_icon_name: default + map_marker_radius_mode: proportional_value + map_marker_units: meters + map_marker_proportional_scale_type: linear + map_marker_color_mode: fixed + show_legend: true + map_value_colors: ["#f9f9f9", "#4285F4", "#185ABC"] + quantize_map_value_colors: false + reverse_map_value_colors: false + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + options: + steps: 5 + y_axes: [{label: '', orientation: bottom, series: [{axisId: Australasia - sessions.total_sessions, + id: Australasia - sessions.total_sessions, name: Australasia}, {axisId: Caribbean + - sessions.total_sessions, id: Caribbean - sessions.total_sessions, + name: Caribbean}, {axisId: Central America - sessions.total_sessions, + id: Central America - sessions.total_sessions, name: Central America}, + {axisId: Central Asia - sessions.total_sessions, id: Central Asia - sessions.total_sessions, + name: Central Asia}, {axisId: Eastern Africa - sessions.total_sessions, + id: Eastern Africa - sessions.total_sessions, name: Eastern Africa}, { + axisId: Eastern Asia - sessions.total_sessions, id: Eastern Asia - sessions.total_sessions, + name: Eastern Asia}, {axisId: Eastern Europe - sessions.total_sessions, + id: Eastern Europe - sessions.total_sessions, name: Eastern Europe}, { + axisId: Melanesia - sessions.total_sessions, id: Melanesia - sessions.total_sessions, + name: Melanesia}, {axisId: Micronesian Region - sessions.total_sessions, + id: Micronesian Region - sessions.total_sessions, name: Micronesian Region}, + {axisId: Middle Africa - sessions.total_sessions, id: Middle Africa - sessions.total_sessions, + name: Middle Africa}, {axisId: Northern Africa - sessions.total_sessions, + id: Northern Africa - sessions.total_sessions, name: Northern Africa}, + {axisId: Northern America - sessions.total_sessions, id: Northern America + - sessions.total_sessions, name: Northern America}, {axisId: Northern + Europe - sessions.total_sessions, id: Northern Europe - sessions.total_sessions, + name: Northern Europe}, {axisId: Polynesia - sessions.total_sessions, + id: Polynesia - sessions.total_sessions, name: Polynesia}, {axisId: South + America - sessions.total_sessions, id: South America - sessions.total_sessions, + name: South America}, {axisId: Southeast Asia - sessions.total_sessions, + id: Southeast Asia - sessions.total_sessions, name: Southeast Asia}, { + axisId: Southern Africa - sessions.total_sessions, id: Southern Africa + - sessions.total_sessions, name: Southern Africa}, {axisId: Southern + Asia - sessions.total_sessions, id: Southern Asia - sessions.total_sessions, + name: Southern Asia}, {axisId: Southern Europe - sessions.total_sessions, + id: Southern Europe - sessions.total_sessions, name: Southern Europe}, + {axisId: Western Africa - sessions.total_sessions, id: Western Africa - + sessions.total_sessions, name: Western Africa}, {axisId: Western Asia + - sessions.total_sessions, id: Western Asia - sessions.total_sessions, + name: Western Asia}, {axisId: Western Europe - sessions.total_sessions, + id: Western Europe - sessions.total_sessions, name: Western Europe}, { + axisId: sessions.geo_data_sub_continent___null - sessions.total_sessions, + id: sessions.geo_data_sub_continent___null - sessions.total_sessions, + name: "∅"}], showLabels: false, showValues: false, unpinAxis: false, tickDensity: default, + type: linear}] + hidden_series: [sessions.total_sessions] + series_types: {} + series_colors: + sessions.total_sessions: "#12B5CB" + sessions.average_session_duration: "#1A73E8" + sessions.total_bounced_sessions_percentage: "#12B5CB" + of_total: "#1A73E8" + series_labels: + sessions.total_sessions: Sessions + sessions.total_bounced_sessions_percentage: Bounce Rate + sessions.average_session_duration: Avg Session Duration + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + single_value_title: Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: + map: auto + map_projection: '' + quantize_colors: false + listen: + Date: sessions.session_date + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + Country [Optional]: sessions.geo_data_country + row: 81 + col: 0 + width: 12 + height: 6 + - title: Languages (Top 10) + name: Languages (Top 10) + model: ga4 + explore: sessions + type: looker_column + fields: [sessions.total_sessions, sessions.device_data_language] + filters: + sessions.device_data_language: "-NULL" + sorts: [sessions.total_sessions desc] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: false + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: true + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + options: + steps: 5 + y_axes: [{label: '', orientation: bottom, series: [{axisId: Australasia - sessions.total_sessions, + id: Australasia - sessions.total_sessions, name: Australasia}, {axisId: Caribbean + - sessions.total_sessions, id: Caribbean - sessions.total_sessions, + name: Caribbean}, {axisId: Central America - sessions.total_sessions, + id: Central America - sessions.total_sessions, name: Central America}, + {axisId: Central Asia - sessions.total_sessions, id: Central Asia - sessions.total_sessions, + name: Central Asia}, {axisId: Eastern Africa - sessions.total_sessions, + id: Eastern Africa - sessions.total_sessions, name: Eastern Africa}, { + axisId: Eastern Asia - sessions.total_sessions, id: Eastern Asia - sessions.total_sessions, + name: Eastern Asia}, {axisId: Eastern Europe - sessions.total_sessions, + id: Eastern Europe - sessions.total_sessions, name: Eastern Europe}, { + axisId: Melanesia - sessions.total_sessions, id: Melanesia - sessions.total_sessions, + name: Melanesia}, {axisId: Micronesian Region - sessions.total_sessions, + id: Micronesian Region - sessions.total_sessions, name: Micronesian Region}, + {axisId: Middle Africa - sessions.total_sessions, id: Middle Africa - sessions.total_sessions, + name: Middle Africa}, {axisId: Northern Africa - sessions.total_sessions, + id: Northern Africa - sessions.total_sessions, name: Northern Africa}, + {axisId: Northern America - sessions.total_sessions, id: Northern America + - sessions.total_sessions, name: Northern America}, {axisId: Northern + Europe - sessions.total_sessions, id: Northern Europe - sessions.total_sessions, + name: Northern Europe}, {axisId: Polynesia - sessions.total_sessions, + id: Polynesia - sessions.total_sessions, name: Polynesia}, {axisId: South + America - sessions.total_sessions, id: South America - sessions.total_sessions, + name: South America}, {axisId: Southeast Asia - sessions.total_sessions, + id: Southeast Asia - sessions.total_sessions, name: Southeast Asia}, { + axisId: Southern Africa - sessions.total_sessions, id: Southern Africa + - sessions.total_sessions, name: Southern Africa}, {axisId: Southern + Asia - sessions.total_sessions, id: Southern Asia - sessions.total_sessions, + name: Southern Asia}, {axisId: Southern Europe - sessions.total_sessions, + id: Southern Europe - sessions.total_sessions, name: Southern Europe}, + {axisId: Western Africa - sessions.total_sessions, id: Western Africa - + sessions.total_sessions, name: Western Africa}, {axisId: Western Asia + - sessions.total_sessions, id: Western Asia - sessions.total_sessions, + name: Western Asia}, {axisId: Western Europe - sessions.total_sessions, + id: Western Europe - sessions.total_sessions, name: Western Europe}, { + axisId: sessions.geo_data_sub_continent___null - sessions.total_sessions, + id: sessions.geo_data_sub_continent___null - sessions.total_sessions, + name: "∅"}], showLabels: false, showValues: false, unpinAxis: false, tickDensity: default, + type: linear}] + limit_displayed_rows_values: + show_hide: show + first_last: first + num_rows: '10' + hidden_series: [sessions.total_sessions] + series_types: {} + series_colors: + sessions.total_sessions: "#1A73E8" + sessions.average_session_duration: "#1A73E8" + sessions.total_bounced_sessions_percentage: "#12B5CB" + of_total: "#1A73E8" + series_labels: + sessions.total_sessions: Sessions + sessions.total_bounced_sessions_percentage: Bounce Rate + sessions.average_session_duration: Avg Session Duration + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + single_value_title: Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: + listen: + Date: sessions.session_date + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + Country [Optional]: sessions.geo_data_country + Continent [Optional]: sessions.geo_data_continent + row: 81 + col: 12 + width: 12 + height: 6 + - title: Non-US Traffic + name: Non-US Traffic + model: ga4 + explore: sessions + type: looker_map + fields: [sessions.total_sessions, sessions.geo_data_country] + filters: + sessions.geo_data_continent: -EMPTY, -NULL, -"(not set)" + sessions.geo_data_country: "-United States" + sorts: [sessions.total_sessions desc] + limit: 500 + column_limit: 50 + map_plot_mode: points + heatmap_gridlines: false + heatmap_gridlines_empty: false + heatmap_opacity: 0.5 + show_region_field: true + draw_map_labels_above_data: true + map_tile_provider: dark + map_position: custom + map_scale_indicator: 'off' + map_pannable: true + map_zoomable: true + map_marker_type: circle + map_marker_icon_name: default + map_marker_radius_mode: proportional_value + map_marker_units: meters + map_marker_proportional_scale_type: linear + map_marker_color_mode: fixed + show_view_names: false + show_legend: true + quantize_map_value_colors: false + reverse_map_value_colors: false + map_latitude: 46.437856895024204 + map_longitude: -52.3828125 + map_zoom: 2 + map_value_colors: ["#f9f9f9", "#4285F4", "#185ABC"] + x_axis_gridlines: false + y_axis_gridlines: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: percent + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + options: + steps: 5 + y_axes: [{label: '', orientation: bottom, series: [{axisId: Australasia - sessions.total_sessions, + id: Australasia - sessions.total_sessions, name: Australasia}, {axisId: Caribbean + - sessions.total_sessions, id: Caribbean - sessions.total_sessions, + name: Caribbean}, {axisId: Central America - sessions.total_sessions, + id: Central America - sessions.total_sessions, name: Central America}, + {axisId: Central Asia - sessions.total_sessions, id: Central Asia - sessions.total_sessions, + name: Central Asia}, {axisId: Eastern Africa - sessions.total_sessions, + id: Eastern Africa - sessions.total_sessions, name: Eastern Africa}, { + axisId: Eastern Asia - sessions.total_sessions, id: Eastern Asia - sessions.total_sessions, + name: Eastern Asia}, {axisId: Eastern Europe - sessions.total_sessions, + id: Eastern Europe - sessions.total_sessions, name: Eastern Europe}, { + axisId: Melanesia - sessions.total_sessions, id: Melanesia - sessions.total_sessions, + name: Melanesia}, {axisId: Micronesian Region - sessions.total_sessions, + id: Micronesian Region - sessions.total_sessions, name: Micronesian Region}, + {axisId: Middle Africa - sessions.total_sessions, id: Middle Africa - sessions.total_sessions, + name: Middle Africa}, {axisId: Northern Africa - sessions.total_sessions, + id: Northern Africa - sessions.total_sessions, name: Northern Africa}, + {axisId: Northern America - sessions.total_sessions, id: Northern America + - sessions.total_sessions, name: Northern America}, {axisId: Northern + Europe - sessions.total_sessions, id: Northern Europe - sessions.total_sessions, + name: Northern Europe}, {axisId: Polynesia - sessions.total_sessions, + id: Polynesia - sessions.total_sessions, name: Polynesia}, {axisId: South + America - sessions.total_sessions, id: South America - sessions.total_sessions, + name: South America}, {axisId: Southeast Asia - sessions.total_sessions, + id: Southeast Asia - sessions.total_sessions, name: Southeast Asia}, { + axisId: Southern Africa - sessions.total_sessions, id: Southern Africa + - sessions.total_sessions, name: Southern Africa}, {axisId: Southern + Asia - sessions.total_sessions, id: Southern Asia - sessions.total_sessions, + name: Southern Asia}, {axisId: Southern Europe - sessions.total_sessions, + id: Southern Europe - sessions.total_sessions, name: Southern Europe}, + {axisId: Western Africa - sessions.total_sessions, id: Western Africa - + sessions.total_sessions, name: Western Africa}, {axisId: Western Asia + - sessions.total_sessions, id: Western Asia - sessions.total_sessions, + name: Western Asia}, {axisId: Western Europe - sessions.total_sessions, + id: Western Europe - sessions.total_sessions, name: Western Europe}, { + axisId: sessions.geo_data_sub_continent___null - sessions.total_sessions, + id: sessions.geo_data_sub_continent___null - sessions.total_sessions, + name: "∅"}], showLabels: false, showValues: false, unpinAxis: false, tickDensity: default, + type: linear}] + hidden_series: [sessions.total_sessions] + series_types: {} + series_colors: + sessions.total_sessions: "#12B5CB" + sessions.average_session_duration: "#1A73E8" + sessions.total_bounced_sessions_percentage: "#12B5CB" + of_total: "#1A73E8" + series_labels: + sessions.total_sessions: Sessions + sessions.total_bounced_sessions_percentage: Bounce Rate + sessions.average_session_duration: Avg Session Duration + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + single_value_title: Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: + map: auto + map_projection: '' + quantize_colors: false + listen: + Date: sessions.session_date + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + row: 87 + col: 0 + width: 12 + height: 9 + - title: United States Traffic + name: United States Traffic + model: ga4 + explore: sessions + type: looker_map + fields: [sessions.total_sessions, sessions.geo_data_region] + filters: + sessions.geo_data_country: United States + sorts: [sessions.total_sessions desc] + limit: 500 + column_limit: 50 + map_plot_mode: points + heatmap_gridlines: false + heatmap_gridlines_empty: false + heatmap_opacity: 0.5 + show_region_field: true + draw_map_labels_above_data: true + map_tile_provider: dark + map_position: custom + map_scale_indicator: 'off' + map_pannable: true + map_zoomable: true + map_marker_type: circle + map_marker_icon_name: default + map_marker_radius_mode: proportional_value + map_marker_units: meters + map_marker_proportional_scale_type: linear + map_marker_color_mode: fixed + show_view_names: false + show_legend: true + quantize_map_value_colors: false + reverse_map_value_colors: false + map_latitude: 36.64253952433933 + map_longitude: -98.10797452926636 + map_zoom: 4 + map_value_colors: ["#f9f9f9", "#4285F4", "#185ABC"] + x_axis_gridlines: false + y_axis_gridlines: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: percent + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + options: + steps: 5 + y_axes: [{label: '', orientation: bottom, series: [{axisId: Australasia - sessions.total_sessions, + id: Australasia - sessions.total_sessions, name: Australasia}, {axisId: Caribbean + - sessions.total_sessions, id: Caribbean - sessions.total_sessions, + name: Caribbean}, {axisId: Central America - sessions.total_sessions, + id: Central America - sessions.total_sessions, name: Central America}, + {axisId: Central Asia - sessions.total_sessions, id: Central Asia - sessions.total_sessions, + name: Central Asia}, {axisId: Eastern Africa - sessions.total_sessions, + id: Eastern Africa - sessions.total_sessions, name: Eastern Africa}, { + axisId: Eastern Asia - sessions.total_sessions, id: Eastern Asia - sessions.total_sessions, + name: Eastern Asia}, {axisId: Eastern Europe - sessions.total_sessions, + id: Eastern Europe - sessions.total_sessions, name: Eastern Europe}, { + axisId: Melanesia - sessions.total_sessions, id: Melanesia - sessions.total_sessions, + name: Melanesia}, {axisId: Micronesian Region - sessions.total_sessions, + id: Micronesian Region - sessions.total_sessions, name: Micronesian Region}, + {axisId: Middle Africa - sessions.total_sessions, id: Middle Africa - sessions.total_sessions, + name: Middle Africa}, {axisId: Northern Africa - sessions.total_sessions, + id: Northern Africa - sessions.total_sessions, name: Northern Africa}, + {axisId: Northern America - sessions.total_sessions, id: Northern America + - sessions.total_sessions, name: Northern America}, {axisId: Northern + Europe - sessions.total_sessions, id: Northern Europe - sessions.total_sessions, + name: Northern Europe}, {axisId: Polynesia - sessions.total_sessions, + id: Polynesia - sessions.total_sessions, name: Polynesia}, {axisId: South + America - sessions.total_sessions, id: South America - sessions.total_sessions, + name: South America}, {axisId: Southeast Asia - sessions.total_sessions, + id: Southeast Asia - sessions.total_sessions, name: Southeast Asia}, { + axisId: Southern Africa - sessions.total_sessions, id: Southern Africa + - sessions.total_sessions, name: Southern Africa}, {axisId: Southern + Asia - sessions.total_sessions, id: Southern Asia - sessions.total_sessions, + name: Southern Asia}, {axisId: Southern Europe - sessions.total_sessions, + id: Southern Europe - sessions.total_sessions, name: Southern Europe}, + {axisId: Western Africa - sessions.total_sessions, id: Western Africa - + sessions.total_sessions, name: Western Africa}, {axisId: Western Asia + - sessions.total_sessions, id: Western Asia - sessions.total_sessions, + name: Western Asia}, {axisId: Western Europe - sessions.total_sessions, + id: Western Europe - sessions.total_sessions, name: Western Europe}, { + axisId: sessions.geo_data_sub_continent___null - sessions.total_sessions, + id: sessions.geo_data_sub_continent___null - sessions.total_sessions, + name: "∅"}], showLabels: false, showValues: false, unpinAxis: false, tickDensity: default, + type: linear}] + hidden_series: [sessions.total_sessions] + series_types: {} + series_colors: + sessions.total_sessions: "#12B5CB" + sessions.average_session_duration: "#1A73E8" + sessions.total_bounced_sessions_percentage: "#12B5CB" + of_total: "#1A73E8" + series_labels: + sessions.total_sessions: Sessions + sessions.total_bounced_sessions_percentage: Bounce Rate + sessions.average_session_duration: Avg Session Duration + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + single_value_title: Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: + map: auto + map_projection: '' + quantize_colors: false + listen: + Date: sessions.session_date + Source [Optional]: sessions.session_attribution_source + Source / Medium [Optional]: sessions.session_attribution_source_medium + Medium [Optional]: sessions.session_attribution_medium + Channel [Optional]: attribution_sources.attribution_source_channel + row: 87 + col: 12 + width: 12 + height: 9 + - name: " (5)" + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t
\n\t\t\n\t

\n\n
" + row: 0 + col: 0 + width: 24 + height: 4 + filters: + - name: Date + title: Date + type: field_filter + default_value: 14 day + allow_multiple_values: true + required: false + ui_config: + type: relative_timeframes + display: inline + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.session_date + - name: Audience Cohort [Required] + title: Audience Cohort [Required] + type: field_filter + default_value: Device + allow_multiple_values: true + required: true + ui_config: + type: dropdown_menu + display: inline + options: + - Device + - Operating System + - Country + - Continent + - Metro + - Language + - Browser + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.audience_selector + - name: Country [Optional] + title: Country [Optional] + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.geo_data_country + - name: Continent [Optional] + title: Continent [Optional] + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: checkboxes + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.geo_data_continent + - name: Source [Optional] + title: Source [Optional] + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.session_attribution_source + - name: Source / Medium [Optional] + title: Source / Medium [Optional] + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.session_attribution_source_medium + - name: Medium [Optional] + title: Medium [Optional] + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.session_attribution_medium + - name: Channel [Optional] + title: Channel [Optional] + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: checkboxes + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: attribution_sources.attribution_source_channel \ No newline at end of file diff --git a/dashboards/avbb.dashboard.lookml b/dashboards/avbb.dashboard.lookml new file mode 100644 index 0000000..38b94e1 --- /dev/null +++ b/dashboards/avbb.dashboard.lookml @@ -0,0 +1,457 @@ +--- +- dashboard: avbb + title: "[GA4] AVBB Model" + layout: newspaper + preferred_viewer: dashboards-next + description: '' + preferred_slug: g2ZthRxhtAWMiEf9V19Hzs + elements: + + - name: " box" + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t
\n\t\t\n\t

\n\n
" + row: 0 + col: 0 + width: 24 + height: 4 + + - name: " (4)" + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t
\n\n
" + row: 0 + col: 0 + width: 20 + height: 2 + + + + + + - title: Feature Attribution for Revenue + name: Feature Attribution for Revenue + model: ga4 + explore: model_explanation + type: looker_bar + fields: [model_explanation.attribution, model_explanation.feature] + sorts: [model_explanation.attribution desc] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + x_axis_zoom: true + y_axis_zoom: true + label_value_format: '0.000' + advanced_vis_config: |- + { + chart: {}, + series: [{ + name: 'Feature' + }] + } + defaults_version: 1 + listen: {} + row: 2 + col: 0 + width: 24 + height: 8 + - title: Category Attribution for Revenue + name: Category Attribution for Revenue + model: ga4 + explore: category_attribution + type: looker_grid + fields: [category_attribution.processed_input, category_attribution.category, + category_attribution.weight, category_attribution.standard_error, category_attribution.p_value] + filters: + category_attribution.category: "-NULL" + sorts: [weight_order desc] + limit: 500 + column_limit: 50 + dynamic_fields: + - category: table_calculation + expression: abs(${category_attribution.weight}) + label: Weight order + value_format: + value_format_name: + _kind_hint: dimension + table_calculation: weight_order + _type_hint: number + show_view_names: false + show_row_numbers: true + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: false + enable_conditional_formatting: false + header_text_alignment: left + header_font_size: '12' + rows_font_size: '12' + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + show_sql_query_menu_options: false + show_totals: true + show_row_totals: true + truncate_header: false + minimum_column_width: 75 + series_cell_visualizations: + category_attribution.p_value: + is_active: false + category_attribution.weight: + is_active: false + value_display: true + series_value_format: + category_attribution.weight: '0.000' + category_attribution.p_value: '0.0000' + category_attribution.standard_error: '0.0000' + x_axis_gridlines: false + y_axis_gridlines: true + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + hidden_fields: [weight_order] + listen: + Processed Input: category_attribution.processed_input + row: 19 + col: 0 + width: 24 + height: 7 + - title: Top Variables + name: Top Variables + model: ga4 + explore: category_attribution + type: looker_column + fields: [category_attribution.processed_input, category_attribution.weight, category_attribution.category, + category_attribution.standard_error, category_attribution.p_value] + filters: + category_attribution.category: "-NULL" + sorts: [weight_order desc] + limit: 500 + column_limit: 50 + dynamic_fields: + - category: table_calculation + expression: abs(${category_attribution.weight}) + label: Weight order + value_format: + value_format_name: + _kind_hint: dimension + table_calculation: weight_order + _type_hint: number + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: true + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + x_axis_zoom: true + y_axis_zoom: true + limit_displayed_rows_values: + show_hide: show + first_last: first + num_rows: '10' + show_row_numbers: true + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + enable_conditional_formatting: false + header_text_alignment: left + header_font_size: '12' + rows_font_size: '12' + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + show_sql_query_menu_options: false + show_totals: true + show_row_totals: true + truncate_header: false + minimum_column_width: 75 + series_cell_visualizations: + category_attribution.p_value: + is_active: false + category_attribution.weight: + is_active: false + value_display: true + series_value_format: + category_attribution.weight: '0.000' + category_attribution.p_value: '0.0000' + category_attribution.standard_error: '0.0000' + defaults_version: 1 + hidden_fields: [weight_order, category_attribution.standard_error, category_attribution.p_value, + category_attribution.processed_input] + show_null_points: true + listen: + Processed Input: category_attribution.processed_input + row: 13 + col: 0 + width: 24 + height: 6 + - name: '' + type: text + title_text: '' + subtitle_text: '' + body_text: "## **Instructions** : \n\nThe top variables show the elasticities\ + \ for each specific category. You can use the filter at the top to understand\ + \ which are the campaigns, devices, sources or mediums that where more important\ + \ to drive revenue. \n" + row: 10 + col: 0 + width: 24 + height: 3 + - name: " (2)" + type: text + title_text: '' + subtitle_text: '' + body_text: | + *** + + ## Aggregated Value Based Bidding + row: 0 + col: 0 + width: 24 + height: 2 + - title: Mean Absolute Error + name: Mean Absolute Error + model: ga4 + explore: evaluation + type: single_value + fields: [evaluation.MAE] + sorts: [evaluation.MAE] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + single_value_title: Mean Absolute Error + value_format: '0.0000' + conditional_formatting: [{type: not null, value: !!null '', background_color: "#1A73E8", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + listen: {} + row: 28 + col: 0 + width: 8 + height: 6 + - title: MSLE + name: MSLE + model: ga4 + explore: evaluation + type: single_value + fields: [evaluation.MSLE] + sorts: [evaluation.MSLE] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + single_value_title: Mean Squared Log error + value_format: '0.000000' + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#FFFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + listen: {} + row: 28 + col: 8 + width: 8 + height: 6 + - title: R2 Score + name: R2 Score + model: ga4 + explore: evaluation + type: single_value + fields: [evaluation.r_squared] + sorts: [evaluation.r_squared] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + single_value_title: R2 Score (Explained Variance) + value_format: '0.000000' + conditional_formatting: [{type: not null, value: !!null '', background_color: "#EA4335", + font_color: "#FFFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + listen: {} + row: 28 + col: 16 + width: 8 + height: 6 + - name: " (3)" + type: text + title_text: '' + subtitle_text: '' + body_text: |+ + *** + + ## Model Metrics + + row: 26 + col: 0 + width: 24 + height: 2 + filters: + - name: Processed Input + title: Processed Input + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: checkboxes + display: popover + model: ga4 + explore: category_attribution + listens_to_filters: [] + field: category_attribution.processed_input \ No newline at end of file diff --git a/dashboards/behavior.dashboard.lookml b/dashboards/behavior.dashboard.lookml new file mode 100644 index 0000000..1280ef6 --- /dev/null +++ b/dashboards/behavior.dashboard.lookml @@ -0,0 +1,695 @@ +- dashboard: behavior + title: "[GA4] Behavior" + layout: newspaper + preferred_viewer: dashboards-next + elements: + - title: Page Views + name: Page Views + model: ga4 + explore: sessions + type: single_value + fields: [events.total_page_views, events.total_unique_page_views] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + comparison_label: Unique Page Views + conditional_formatting: [{type: not null, value: !!null '', background_color: "#c73727", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + hidden_fields: [] + y_axes: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 7 + col: 0 + width: 24 + height: 4 + - title: Top Pages + name: Top Pages + model: ga4 + explore: sessions + type: looker_bar + fields: [events.total_page_views, events.total_unique_page_views, events.event_param_page] + filters: + events.event_param_page: "-EMPTY" + sorts: [events.total_page_views desc] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: false + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: true + legend_position: center + point_style: circle + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + y_axes: [{label: '', orientation: bottom, series: [{axisId: events.total_page_views, + id: events.total_page_views, name: Total Page Views}, {axisId: events.total_unique_page_views, + id: events.total_unique_page_views, name: Total Unique Page Views}], showLabels: false, + showValues: false, unpinAxis: false, tickDensity: default, tickDensityCustom: 5, + type: linear}] + size_by_field: event_data.total_unique_page_views + limit_displayed_rows_values: + show_hide: show + first_last: first + num_rows: '10' + series_types: + events.total_unique_page_views: scatter + series_colors: + events.total_page_views: "#B31412" + events.total_unique_page_views: "#BDC1C6" + label_color: ["#B31412", transparent] + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + comparison_label: Unique Page Views + conditional_formatting: [{type: not null, value: !!null '', background_color: "#c73727", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 11 + col: 0 + width: 10 + height: 10 + - title: Top Page Detail + name: Top Page Detail + model: ga4 + explore: sessions + type: looker_grid + fields: [events.event_param_page, events.total_page_views, events.total_unique_page_views, + events.average_time_to_next_page, events.entrance_rate, events.bounce_rate, + events.exit_rate] + filters: + events.event_param_page: "-EMPTY" + sorts: [events.total_page_views desc] + limit: 500 + column_limit: 50 + show_view_names: false + show_row_numbers: true + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: false + enable_conditional_formatting: true + header_text_alignment: left + header_font_size: '12' + rows_font_size: '12' + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + show_sql_query_menu_options: false + show_totals: true + show_row_totals: true + series_cell_visualizations: + event_data.total_page_views: + is_active: false + event_data.total_unique_page_views: + is_active: true + limit_displayed_rows_values: + show_hide: show + first_last: first + num_rows: '10' + conditional_formatting: [{type: along a scale..., value: !!null '', background_color: "#c73727", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + custom: {id: 2c56dd64-603d-8884-bf2c-89e6eeba3863, label: Custom, type: continuous, + stops: [{color: "#FFFFFF", offset: 0}, {color: "#EA4335", offset: 50}, + {color: "#B31412", offset: 100}]}, options: {steps: 5, constraints: { + min: {type: percentile, value: 10}, max: {type: percentile, value: 99}}}}, + bold: false, italic: false, strikethrough: false, fields: [events.bounce_rate, + events.exit_rate]}, {type: along a scale..., value: !!null '', background_color: "#1A73E8", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + custom: {id: 0f27b0fc-14e6-c15e-9c53-7b0f52ed85b4, label: Custom, type: continuous, + stops: [{color: "#FFFFFF", offset: 0}, {color: "#34A853", offset: 50}, + {color: "#137333", offset: 100}]}, options: {steps: 5, constraints: { + min: {type: minimum}, mid: {type: middle}, max: {type: percentile, value: 99}}, + mirror: false, reverse: false, stepped: false}}, bold: false, italic: false, + strikethrough: false, fields: [events.entrance_rate]}, {type: along a scale..., + value: !!null '', background_color: "#1A73E8", font_color: !!null '', color_application: { + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab, + options: {steps: 5, constraints: {min: {type: percentile, value: 1}, mid: { + type: middle}, max: {type: percentile, value: 99}}, mirror: false, + reverse: false, stepped: false}}, bold: false, italic: false, strikethrough: false, + fields: [events.average_time_to_next_page]}] + x_axis_gridlines: false + y_axis_gridlines: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + legend_position: center + point_style: circle + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + y_axes: [{label: '', orientation: bottom, series: [{axisId: events.total_page_views, + id: events.total_page_views, name: Total Page Views}, {axisId: events.total_unique_page_views, + id: events.total_unique_page_views, name: Total Unique Page Views}], showLabels: false, + showValues: false, unpinAxis: false, tickDensity: default, tickDensityCustom: 5, + type: linear}] + size_by_field: event_data.total_unique_page_views + series_types: {} + series_colors: + events.total_page_views: "#B31412" + events.total_unique_page_views: "#BDC1C6" + label_color: ["#B31412", transparent] + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + custom_color: "#FFF" + comparison_label: Unique Page Views + defaults_version: 1 + hidden_fields: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 11 + col: 10 + width: 14 + height: 10 + - name: '' + type: text + title_text: '' + subtitle_text: '' + body_text: "---\n
\n\t
\n\t\t

Landing Pages

\n
" + row: 21 + col: 0 + width: 24 + height: 3 + - title: Top Landing Page + name: Top Landing Page + model: ga4 + explore: sessions + type: looker_bar + fields: [sessions.total_sessions, sessions.landing_page, sessions.percentage_new_users] + sorts: [sessions.total_sessions desc] + limit: 500 + column_limit: 50 + filter_expression: ${sessions.landing_page} != "null" + x_axis_gridlines: false + y_axis_gridlines: false + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: true + legend_position: center + point_style: circle + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + y_axes: [{label: '', orientation: bottom, series: [{axisId: sessions.total_sessions, + id: sessions.total_sessions, name: Total Sessions}], showLabels: false, + showValues: false, unpinAxis: false, tickDensity: default, tickDensityCustom: 5, + type: linear}, {label: !!null '', orientation: bottom, series: [{axisId: sessions.percentage_new_users, + id: sessions.percentage_new_users, name: Total New Users - Percentage}], + showLabels: false, showValues: false, unpinAxis: false, tickDensity: default, + tickDensityCustom: 5, type: linear}] + size_by_field: '' + limit_displayed_rows_values: + show_hide: show + first_last: first + num_rows: '10' + hidden_series: [of_total] + series_types: + sessions.percentage_new_users: scatter + series_colors: + sessions.total_sessions: "#F9AB00" + of_total: "#facb04" + sessions.percentage_new_users: "#1A73E8" + label_color: ["#FBBC04", transparent] + defaults_version: 1 + hidden_fields: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 24 + col: 0 + width: 10 + height: 14 + - title: Landing Page Detail + name: Landing Page Detail + model: ga4 + explore: sessions + type: looker_grid + fields: [sessions.landing_page, sessions.total_sessions, events.total_purchase_revenue_usd, + events.transaction_conversion_rate, sessions.total_bounced_sessions_percentage, + sessions.total_first_visit_sessions_percentage, sessions.average_session_duration, + sessions.average_page_views_per_session] + filters: {} + sorts: [sessions.total_sessions desc] + limit: 500 + filter_expression: ${sessions.landing_page} != "null" + show_view_names: false + show_row_numbers: true + transpose: false + truncate_text: false + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: true + enable_conditional_formatting: true + header_text_alignment: left + header_font_size: '12' + rows_font_size: '12' + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + show_sql_query_menu_options: false + show_totals: true + show_row_totals: true + series_labels: + sessions.total_sessions: Sessions + sessions.total_first_visit_sessions_percentage: New Session % + sessions.average_session_duration: Avg. Session Duration + sessions.average_page_views_per_session: Avg. Pages/Session + sessions.total_bounced_sessions_percentage: Bounce Rate + events.total_purchase_revenue_usd: Total Transaction Revenue (USD) + events.transaction_conversion_rate: Transaction Conversion Rate + series_column_widths: + page_entrance_exit.landing_page: 400 + series_cell_visualizations: + sessions.total_sessions: + is_active: false + limit_displayed_rows_values: + show_hide: show + first_last: first + num_rows: '20' + conditional_formatting: [{type: along a scale..., value: !!null '', background_color: "#1A73E8", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + custom: {id: fa3c8c8a-897c-aa1c-b569-cd8ca8fb0929, label: Custom, type: continuous, + stops: [{color: "#FFFFFF", offset: 0}, {color: "#EA4335", offset: 50}, + {color: "#B31412", offset: 100}]}, options: {steps: 5, constraints: { + min: {type: percentile, value: 10}, mid: {type: middle}, max: {type: percentile, + value: 99}}, mirror: false, reverse: false, stepped: false}}, bold: false, + italic: false, strikethrough: false, fields: [sessions.total_bounced_sessions_percentage]}, + {type: along a scale..., value: !!null '', background_color: "#1A73E8", font_color: !!null '', + color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, custom: { + id: 75d8e36b-a316-d634-6acd-3178ba62b4e7, label: Custom, type: continuous, + stops: [{color: "#FFFFFF", offset: 0}, {color: "#34A853", offset: 50}, + {color: "#137333", offset: 100}]}, options: {steps: 5, constraints: { + min: {type: minimum}, mid: {type: middle}, max: {type: percentile, value: 99}}, + mirror: false, reverse: false, stepped: false}}, bold: false, italic: false, + strikethrough: false, fields: [events.total_purchase_revenue_usd]}, {type: along + a scale..., value: !!null '', background_color: "#1A73E8", font_color: !!null '', + color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, custom: { + id: 913646fc-3538-c9f1-92b6-326d34356927, label: Custom, type: continuous, + stops: [{color: "#FFFFFF", offset: 0}, {color: "#34A853", offset: 50}, + {color: "#137333", offset: 100}]}, options: {steps: 5, constraints: { + min: {type: minimum}, mid: {type: middle}, max: {type: percentile, value: 99}}, + mirror: false, reverse: false, stepped: false}}, bold: false, italic: false, + strikethrough: false, fields: [events.transaction_conversion_rate]}, {type: along + a scale..., value: !!null '', background_color: "#1A73E8", font_color: !!null '', + color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab, + options: {steps: 5, constraints: {min: {type: percentile, value: 1}, mid: { + type: middle}, max: {type: percentile, value: 99}}, mirror: false, + reverse: false, stepped: false}}, bold: false, italic: false, strikethrough: false, + fields: [sessions.total_first_visit_sessions_percentage]}, {type: along a + scale..., value: !!null '', background_color: "#1A73E8", font_color: !!null '', + color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab, + options: {steps: 5, constraints: {min: {type: percentile, value: 1}, mid: { + type: middle}, max: {type: percentile, value: 99}}, mirror: false, + reverse: false, stepped: false}}, bold: false, italic: false, strikethrough: false, + fields: [sessions.average_session_duration]}, {type: along a scale..., value: !!null '', + background_color: "#1A73E8", font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab, options: {steps: 5, constraints: { + min: {type: minimum}, mid: {type: middle}, max: {type: percentile, value: 99}}, + mirror: false, reverse: false, stepped: false}}, bold: false, italic: false, + strikethrough: false, fields: [sessions.average_page_views_per_session]}] + x_axis_gridlines: false + y_axis_gridlines: true + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + hidden_fields: [] + y_axes: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 24 + col: 10 + width: 14 + height: 14 + - title: Top Keyword Searches + name: Top Keyword Searches + model: ga4 + explore: sessions + type: looker_bar + fields: [sessions.total_sessions, events.event_param_term] + filters: {} + sorts: [sessions.total_sessions desc] + limit: 500 + column_limit: 50 + filter_expression: ${events.event_param_term} != "null" + x_axis_gridlines: false + y_axis_gridlines: false + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: true + legend_position: center + point_style: circle + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + y_axes: [{label: '', orientation: bottom, series: [{axisId: sessions.total_sessions, + id: sessions.total_sessions, name: Total Sessions}], showLabels: false, + showValues: false, unpinAxis: false, tickDensity: default, tickDensityCustom: 5, + type: linear}, {label: !!null '', orientation: bottom, series: [{axisId: sessions.percentage_new_users, + id: sessions.percentage_new_users, name: Total New Users - Percentage}], + showLabels: false, showValues: false, unpinAxis: false, tickDensity: default, + tickDensityCustom: 5, type: linear}] + size_by_field: '' + limit_displayed_rows_values: + show_hide: show + first_last: first + num_rows: '10' + hidden_series: [of_total] + series_types: + sessions.percentage_new_users: scatter + series_colors: + sessions.total_sessions: "#F9AB00" + of_total: "#facb04" + sessions.percentage_new_users: "#1A73E8" + label_color: ["#FBBC04", transparent] + defaults_version: 1 + hidden_fields: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 42 + col: 0 + width: 12 + height: 10 + - title: Top Events + name: Top Events + model: ga4 + explore: sessions + type: looker_bar + fields: [events.total_events, events.total_unique_events, events.full_event] + filters: {} + sorts: [events.total_events desc] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: true + legend_position: center + point_style: circle + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + y_axes: [{label: '', orientation: bottom, series: [{axisId: events.total_events, + id: events.total_events, name: Total Events}], showLabels: false, showValues: false, + unpinAxis: false, tickDensity: default, tickDensityCustom: 5, type: linear}, + {label: !!null '', orientation: bottom, series: [{axisId: events.total_unique_events, + id: events.total_unique_events, name: Total Unique Events}], showLabels: false, + showValues: false, unpinAxis: false, tickDensity: default, tickDensityCustom: 5, + type: linear}] + limit_displayed_rows_values: + show_hide: show + first_last: first + num_rows: '10' + series_types: + events.total_unique_events: scatter + series_colors: + events.total_events: "#F9AB00" + events.total_unique_events: "#1A73E8" + defaults_version: 1 + hidden_fields: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 42 + col: 12 + width: 12 + height: 10 + - name: " (2)" + type: text + title_text: '' + subtitle_text: '' + body_text: "\n
\n\t
\n\t\t

Events

Event Name + Event\ + \ Page

\n
" + row: 38 + col: 12 + width: 12 + height: 4 + - name: " (3)" + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t
\n\t\t

Keywords

Keyword of the traffic\ + \ source, usually set when the medium is “organic” or “cpc” (i.e. What phrase\ + \ did they search to get to find the website?)

\n
" + row: 38 + col: 0 + width: 12 + height: 4 + - name: " (4)" + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t
\n\t\t\n\t

\n\n
" + row: 0 + col: 0 + width: 24 + height: 4 + - name: " (5)" + type: text + title_text: '' + subtitle_text: '' + body_text: "---\n
\n\t
\n\t\t

Behavior

\n
" + row: 4 + col: 0 + width: 24 + height: 3 + filters: + - name: Date + title: Date + type: field_filter + default_value: 7 day + allow_multiple_values: true + required: false + ui_config: + type: relative_timeframes + display: inline + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.session_date + - name: Landing Page + title: Landing Page + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.landing_page \ No newline at end of file diff --git a/dashboards/campaign_impact.dashboard.lookml b/dashboards/campaign_impact.dashboard.lookml new file mode 100644 index 0000000..a0164a6 --- /dev/null +++ b/dashboards/campaign_impact.dashboard.lookml @@ -0,0 +1,561 @@ +- dashboard: ga4_campaign_impact + title: "[GA4] Campaign Impact" + layout: newspaper + preferred_viewer: dashboards-next + elements: + - title: Users saw the campaign page + name: Users saw the campaign page + model: ga4 + explore: sessions + type: single_value + fields: [sessions.total_users, user_segment.segment_users, user_segment.retention_rate] + filters: + events.event_param_page: '' + limit: 500 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + conditional_formatting: [{type: not null, value: !!null '', background_color: "#1A73E8", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + hidden_fields: [user_segment.segment_users, user_segment.retention_rate] + listen: + Audience Selector: sessions.audience_selector + Campaign Date: sessions.session_date + User Return Date: user_segment.user_segment_timeframe + Page: sessions.landing_page + row: 5 + col: 0 + width: 12 + height: 4 + - title: Users Returned + name: Users Returned + model: ga4 + explore: sessions + type: single_value + fields: [sessions.total_users, user_segment.segment_users, user_segment.retention_rate] + filters: + events.event_param_page: '' + limit: 500 + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + conditional_formatting: [{type: not null, value: !!null '', background_color: "#1A73E8", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + hidden_fields: [sessions.total_users] + listen: + Audience Selector: sessions.audience_selector + Campaign Date: sessions.session_date + User Return Date: user_segment.user_segment_timeframe + Page: sessions.landing_page + row: 5 + col: 12 + width: 12 + height: 4 + - title: Retained User Transaction Conversion Rate + name: Retained User Transaction Conversion Rate + model: ga4 + explore: sessions + type: single_value + fields: [events.transaction_conversion_rate, user_segment.segment_transaction_conversion_rate] + filters: + events.event_param_page: '' + limit: 500 + dynamic_fields: [{_kind_hint: measure, table_calculation: change, _type_hint: number, + category: table_calculation, expression: "${user_segment.segment_transaction_conversion_rate}-${events.transaction_conversion_rate}", + label: Change, value_format: !!null '', value_format_name: percent_1}] + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: change + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + comparison_label: conversion rate driven by campaign + conditional_formatting: [{type: not null, value: !!null '', background_color: "#EA4335", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + hidden_fields: [events.transaction_conversion_rate] + listen: + Audience Selector: sessions.audience_selector + Campaign Date: sessions.session_date + User Return Date: user_segment.user_segment_timeframe + Page: sessions.landing_page + row: 9 + col: 12 + width: 12 + height: 4 + - title: Transaction Conversion Rate + name: Transaction Conversion Rate + model: ga4 + explore: sessions + type: single_value + fields: [events.transaction_conversion_rate, user_segment.segment_transaction_conversion_rate] + filters: + events.event_param_page: '' + limit: 500 + dynamic_fields: [{_kind_hint: measure, table_calculation: change, _type_hint: number, + category: table_calculation, expression: "${user_segment.segment_transaction_conversion_rate}-${events.transaction_conversion_rate}", + label: Change, value_format: !!null '', value_format_name: percent_1}] + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: change + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + comparison_label: conversion rate driven by campaign + conditional_formatting: [{type: not null, value: !!null '', background_color: "#EA4335", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + hidden_fields: [user_segment.segment_transaction_conversion_rate, change] + listen: + Audience Selector: sessions.audience_selector + Campaign Date: sessions.session_date + User Return Date: user_segment.user_segment_timeframe + Page: sessions.landing_page + row: 9 + col: 0 + width: 12 + height: 4 + - title: Revenue per User + name: Revenue per User + model: ga4 + explore: sessions + type: single_value + fields: [events.transaction_revenue_per_user] + filters: + events.event_param_page: '' + limit: 500 + column_limit: 50 + dynamic_fields: [{_kind_hint: measure, table_calculation: change, _type_hint: number, + category: table_calculation, expression: "${user_segment.segment_transaction_revenue_per_user}/${events.transaction_revenue_per_user}-1", + label: Change, value_format: !!null '', value_format_name: percent_0, is_disabled: true}] + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#ffffff" + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#ffffff", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + hidden_fields: [] + y_axes: [] + listen: + Audience Selector: sessions.audience_selector + Campaign Date: sessions.session_date + User Return Date: user_segment.user_segment_timeframe + Page: sessions.landing_page + row: 13 + col: 0 + width: 12 + height: 4 + - title: Revenue per Retained User + name: Revenue per Retained User + model: ga4 + explore: sessions + type: single_value + fields: [user_segment.segment_transaction_revenue_per_user, events.transaction_revenue_per_user] + filters: + events.event_param_page: '' + limit: 500 + column_limit: 50 + dynamic_fields: [{category: table_calculation, expression: "${user_segment.segment_transaction_revenue_per_user}/${events.transaction_revenue_per_user}-1", + label: Change, value_format: !!null '', value_format_name: percent_0, _kind_hint: measure, + table_calculation: change, _type_hint: number}] + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: change + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: '' + comparison_label: revenue per user driven by campaign + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#ffffff", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + hidden_fields: [events.transactions_per_user, events.transaction_revenue_per_user] + listen: + Audience Selector: sessions.audience_selector + Campaign Date: sessions.session_date + User Return Date: user_segment.user_segment_timeframe + Page: sessions.landing_page + row: 13 + col: 12 + width: 12 + height: 4 + - title: Impact by Audience + name: Impact by Audience + model: ga4 + explore: sessions + type: looker_grid + fields: [sessions.audience_trait, sessions.total_users, user_segment.segment_users, + events.transaction_revenue_per_user, user_segment.segment_transaction_revenue_per_user, + events.transaction_conversion_rate, user_segment.segment_transaction_conversion_rate] + filters: + events.event_param_page: '' + sorts: [conversion_rate_change desc] + limit: 500 + column_limit: 50 + dynamic_fields: [{_kind_hint: measure, table_calculation: retention_rate, _type_hint: number, + category: table_calculation, expression: "${user_segment.segment_users}/${sessions.total_users}", + label: Retention Rate, value_format: !!null '', value_format_name: percent_1}, + {_kind_hint: measure, table_calculation: conversion_rate_change, _type_hint: number, + category: table_calculation, expression: "${user_segment.segment_transaction_conversion_rate}-${events.transaction_conversion_rate}", + label: Conversion Rate Change, value_format: !!null '', value_format_name: percent_1}, + {category: table_calculation, expression: "(${user_segment.segment_transaction_revenue_per_user}/${events.transaction_revenue_per_user})\ + \ -1", label: Rev per User Change, value_format: !!null '', value_format_name: percent_1, + _kind_hint: measure, table_calculation: rev_per_user_change, _type_hint: number}] + show_view_names: false + show_row_numbers: true + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: false + enable_conditional_formatting: false + header_text_alignment: left + header_font_size: '12' + rows_font_size: '14' + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + show_sql_query_menu_options: false + column_order: ["$$$_row_numbers_$$$", sessions.audience_trait, retention_rate, + events.transaction_revenue_per_user, user_segment.segment_transaction_revenue_per_user, + rev_per_user_change, events.transaction_conversion_rate, user_segment.segment_transaction_conversion_rate, + conversion_rate_change] + show_totals: true + show_row_totals: true + series_labels: + events.transactions_per_user: Transactions / User + user_segment.segment_transaction_revenue_per_user: Revenue / Retained User + user_segment.segment_transaction_conversion_rate: Retained User Conversion Rate + events.transaction_conversion_rate: Conversion Rate + rev_per_user_change: Δ + conversion_rate_change: Δ + events.transaction_revenue_per_user: Revenue / User + series_cell_visualizations: + events.transactions_per_user: + is_active: false + retention_rate: + is_active: true + conversion_rate_change: + is_active: true + rev_per_user_change: + is_active: true + header_background_color: "#7CB342" + x_axis_gridlines: false + y_axis_gridlines: true + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + hidden_fields: [sessions.total_users, user_segment.segment_users] + listen: + Audience Selector: sessions.audience_selector + Campaign Date: sessions.session_date + User Return Date: user_segment.user_segment_timeframe + Page: sessions.landing_page + row: 17 + col: 0 + width: 24 + height: 8 + - name: '' + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t
\n\t\t

GA4 Campaign Impact

Recommended\ + \ Action
\n Select a period and landing page for a campaign\ + \ you ran, and measure its retention and upsell impact. Observe\ + \ which audiences are benefitting the most from this campaign to better\ + \ target in the future.\n

\n
" + row: 0 + col: 0 + width: 24 + height: 5 + filters: + - name: Campaign Date + title: Campaign Date + type: field_filter + default_value: 30 day + allow_multiple_values: true + required: false + ui_config: + type: advanced + display: inline + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.session_date + - name: User Return Date + title: User Return Date + type: field_filter + default_value: 7 day + allow_multiple_values: true + required: false + ui_config: + type: advanced + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: user_segment.user_segment_timeframe + - name: Page + title: Page + type: field_filter + default_value: "/" + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.landing_page + - name: Audience Selector + title: Audience Selector + type: field_filter + default_value: Channel + allow_multiple_values: true + required: false + ui_config: + type: dropdown_menu + display: inline + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.audience_selector \ No newline at end of file diff --git a/dashboards/custom_goal_conversions.dashboard.lookml b/dashboards/custom_goal_conversions.dashboard.lookml new file mode 100644 index 0000000..5a52106 --- /dev/null +++ b/dashboards/custom_goal_conversions.dashboard.lookml @@ -0,0 +1,950 @@ +- dashboard: custom_goal_conversions + title: "[GA4] Custom Goal Conversions" + layout: newspaper + preferred_viewer: dashboards-next + elements: + - name: '' + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t
\n\t\t

Custom Conversions

Instructions:\ + \ Select any permutation of Event Name and/or Page filters at\ + \ the top to select your goal(s). Then click the Load/Update button at\ + \ the top right.\n
\nOptional: Update Audience Selector filter\ + \ to update the Conversion Rate by Audience Cohort tile

\n
\n" + row: 4 + col: 0 + width: 24 + height: 4 + - name: " (2)" + type: text + title_text: '' + subtitle_text: '' + body_text: "---\n
\n\t

Sessions that have at least one goal completed compared to total sessions\ + \ in timeframe

\n
\n" + row: 8 + col: 0 + width: 24 + height: 2 + - title: Sessions + name: Sessions + model: ga4 + explore: sessions + type: single_value + fields: [sessions.total_sessions] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + color_application: + collection_id: legacy + palette_id: looker_classic + custom_color: "#FFF" + single_value_title: Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + listen: + 'Goal: Event Name': events.event_name_goal_selection + 'Goal: Event Page': events.page_goal_selection + Audience Selector: sessions.audience_selector + Session Date: sessions.session_date + row: 10 + col: 0 + width: 14 + height: 2 + - title: Sessions with Conversion + name: Sessions with Conversion + model: ga4 + explore: sessions + type: single_value + fields: [events.sessions_with_conversions] + sorts: [events.sessions_with_conversions desc] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + y_axes: [{label: '', orientation: bottom, series: [{axisId: events.sessions_with_conversions, + id: events.sessions_with_conversions, name: Sessions with Conversion}], + showLabels: false, showValues: true, unpinAxis: false, tickDensity: default, + tickDensityCustom: 5, type: linear}, {label: !!null '', orientation: bottom, + series: [{axisId: event_data.session_conversion_rate, id: event_data.session_conversion_rate, + name: Session Conversion Rate}], showLabels: false, showValues: false, + unpinAxis: false, tickDensity: default, tickDensityCustom: 5, type: linear}] + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + series_types: {} + point_style: circle + series_colors: + event_data.session_conversion_rate: "#4285F4" + events.sessions_with_conversions: "#34A853" + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + custom_color: "#FFF" + single_value_title: Converting Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#34A853", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: [] + listen: + 'Goal: Event Name': events.event_name_goal_selection + 'Goal: Event Page': events.page_goal_selection + Audience Selector: sessions.audience_selector + Session Date: sessions.session_date + row: 10 + col: 14 + width: 5 + height: 2 + - title: Session CNV Rate + name: Session CNV Rate + model: ga4 + explore: sessions + type: single_value + fields: [events.session_conversion_rate] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + custom_color: "#FFF" + single_value_title: Session CNV Rate + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#1A73E8", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + hidden_fields: [] + y_axes: [] + listen: + 'Goal: Event Name': events.event_name_goal_selection + 'Goal: Event Page': events.page_goal_selection + Audience Selector: sessions.audience_selector + Session Date: sessions.session_date + row: 10 + col: 19 + width: 5 + height: 2 + - title: Custom Goal Conversion Rate + name: Custom Goal Conversion Rate + model: ga4 + explore: sessions + type: looker_column + fields: [sessions.total_sessions, sessions.session_date, events.has_completed_goal] + pivots: [events.has_completed_goal] + fill_fields: [sessions.session_date, events.has_completed_goal] + sorts: [events.has_completed_goal, sessions.total_sessions 2] + limit: 500 + column_limit: 50 + row_total: right + dynamic_fields: [{table_calculation: rolling_7_day_conversion_rate, label: Rolling + 7-day Conversion Rate, expression: "pivot_where(\n ${events.has_completed_goal}=yes\n\ + \ , mean(\n offset_list(${sessions.total_sessions}/${sessions.total_sessions:row_total},-6,7)\n\ + \ )\n)", value_format: !!null '', value_format_name: percent_0, _kind_hint: supermeasure, + _type_hint: number}, {table_calculation: sessions, label: Sessions, expression: "${sessions.total_sessions}", + value_format: !!null '', value_format_name: !!null '', _kind_hint: measure, + _type_hint: number}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: normal + limit_displayed_rows: false + legend_position: center + point_style: circle + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + y_axes: [{label: '', orientation: left, series: [{axisId: No - sessions, id: No + - sessions, name: Sessions}, {axisId: Yes - sessions, id: Yes - sessions, + name: Sessions with Conversion}], showLabels: true, showValues: true, + unpinAxis: false, tickDensity: default, tickDensityCustom: 5, type: linear}, + {label: !!null '', orientation: right, series: [{axisId: rolling_7_day_conversion_rate, + id: rolling_7_day_conversion_rate, name: Rolling 7-day Conversion Rate}], + showLabels: true, showValues: true, unpinAxis: false, tickDensity: default, + tickDensityCustom: 5, type: linear}] + hidden_series: [Row Total - sessions.total_sessions] + series_types: + Row Total - sessions.total_sessions: scatter + rolling_7_day_conversion_rate: line + series_colors: + Row Total - sessions.total_sessions: "#e3e6e0" + Yes - sessions: "#34A853" + No - sessions: "#FBBC04" + rolling_7_day_conversion_rate: "#1A73E8" + series_labels: + No - sessions: Sessions + Yes - sessions: Sessions with Conversion + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + single_value_title: Converting Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#34A853", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + show_row_numbers: true + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + header_text_alignment: left + header_font_size: 12 + rows_font_size: 12 + hidden_fields: [sessions.total_sessions] + listen: + 'Goal: Event Name': events.event_name_goal_selection + 'Goal: Event Page': events.page_goal_selection + Audience Selector: sessions.audience_selector + Session Date: sessions.session_date + row: 12 + col: 0 + width: 14 + height: 10 + - title: Session Conversion Rate by Audience Cohort + name: Session Conversion Rate by Audience Cohort + model: ga4 + explore: sessions + type: looker_bar + fields: [events.sessions_with_conversions, sessions.audience_trait, events.session_conversion_rate] + sorts: [events.sessions_with_conversions desc] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: circle + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + y_axes: [{label: '', orientation: bottom, series: [{axisId: events.sessions_with_conversions, + id: events.sessions_with_conversions, name: Sessions with Conversion}], + showLabels: false, showValues: true, unpinAxis: false, tickDensity: default, + tickDensityCustom: 5, type: linear}, {label: !!null '', orientation: bottom, + series: [{axisId: events.session_conversion_rate, id: events.session_conversion_rate, + name: Session Conversion Rate}], showLabels: false, showValues: false, + unpinAxis: false, tickDensity: default, tickDensityCustom: 5, type: linear}] + series_types: + events.session_conversion_rate: scatter + series_colors: + events.sessions_with_conversions: "#34A853" + events.session_conversion_rate: "#4285F4" + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + single_value_title: Converting Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#34A853", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: [] + listen: + 'Goal: Event Name': events.event_name_goal_selection + 'Goal: Event Page': events.page_goal_selection + Audience Selector: sessions.audience_selector + Session Date: sessions.session_date + row: 12 + col: 14 + width: 10 + height: 10 + - name: " (3)" + type: text + title_text: '' + subtitle_text: '' + body_text: "---\n
\n\t
\n\t\t

Total Conversions

Total\ + \ number of hits (Page or Event) that match the goals set in dashboard filters

" + row: 22 + col: 0 + width: 24 + height: 4 + - title: Events with Conversion + name: Events with Conversion + model: ga4 + explore: sessions + type: single_value + fields: [events.conversion_count] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + custom_color: "#FFF" + single_value_title: Total Conversions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#B31412", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + y_axes: [{label: '', orientation: bottom, series: [{axisId: event_data.sessions_with_conversions, + id: event_data.sessions_with_conversions, name: Sessions with Conversion}], + showLabels: false, showValues: true, unpinAxis: false, tickDensity: default, + tickDensityCustom: 5, type: linear}, {label: !!null '', orientation: bottom, + series: [{axisId: event_data.session_conversion_rate, id: event_data.session_conversion_rate, + name: Session Conversion Rate}], showLabels: false, showValues: false, + unpinAxis: false, tickDensity: default, tickDensityCustom: 5, type: linear}] + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + series_types: {} + point_style: circle + series_colors: + event_data.sessions_with_conversions: "#34A853" + event_data.session_conversion_rate: "#4285F4" + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + hidden_fields: [] + listen: + 'Goal: Event Name': events.event_name_goal_selection + 'Goal: Event Page': events.page_goal_selection + Audience Selector: sessions.audience_selector + Session Date: sessions.session_date + row: 26 + col: 0 + width: 24 + height: 2 + - title: Top Goal Completion Page(s) + name: Top Goal Completion Page(s) + model: ga4 + explore: sessions + type: looker_bar + fields: [events.conversion_count, events.event_param_page, events.session_conversion_rate] + filters: + events.event_param_page: "-EMPTY" + sorts: [events.conversion_count desc] + limit: 10 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: circle + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + y_axes: [{label: !!null '', orientation: bottom, series: [{axisId: events.session_conversion_rate, + id: events.session_conversion_rate, name: Session Conversion Rate}], showLabels: false, + showValues: false, unpinAxis: false, tickDensity: default, tickDensityCustom: 5, + type: linear}, {label: '', orientation: bottom, series: [{axisId: events.conversion_count, + id: events.conversion_count, name: Total Conversions}], showLabels: false, + showValues: false, unpinAxis: false, tickDensity: default, type: linear}] + size_by_field: event_data.session_conversion_rate + series_types: + events.session_conversion_rate: scatter + series_colors: + event_data.sessions_with_conversions: "#34A853" + events.conversion_count: "#B31412" + events.session_conversion_rate: "#4285F4" + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + single_value_title: Total Conversions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#B31412", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: [] + listen: + 'Goal: Event Name': events.event_name_goal_selection + 'Goal: Event Page': events.page_goal_selection + Audience Selector: sessions.audience_selector + Session Date: sessions.session_date + row: 28 + col: 0 + width: 12 + height: 11 + - title: Top Events + name: Top Events + model: ga4 + explore: sessions + type: looker_bar + fields: [events.conversion_count, events.full_event] + filters: + events.event_param_page: "-EMPTY" + sorts: [events.conversion_count desc] + limit: 10 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: circle + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + y_axes: [{label: !!null '', orientation: bottom, series: [{axisId: event_data.session_conversion_rate, + id: event_data.session_conversion_rate, name: Session Conversion Rate}], + showLabels: false, showValues: false, unpinAxis: false, tickDensity: default, + tickDensityCustom: 5, type: linear}, {label: '', orientation: bottom, series: [ + {axisId: events.conversion_count, id: events.conversion_count, name: Total + Conversions}], showLabels: false, showValues: false, unpinAxis: false, + tickDensity: default, type: linear}] + size_by_field: event_data.session_conversion_rate + series_types: + event_data.session_conversion_rate: scatter + series_colors: + event_data.sessions_with_conversions: "#34A853" + event_data.session_conversion_rate: "#4285F4" + events.conversion_count: "#B31412" + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + single_value_title: Total Conversions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#B31412", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: [] + listen: + 'Goal: Event Name': events.event_name_goal_selection + 'Goal: Event Page': events.page_goal_selection + Audience Selector: sessions.audience_selector + Session Date: sessions.session_date + row: 28 + col: 12 + width: 12 + height: 11 + - name: " (4)" + type: text + title_text: '' + subtitle_text: '' + body_text: "---\n
\n\t
\n\t\t

Reverse Goal Path

Read\ + \ Data from Right to Left:

\n\n\n" + row: 39 + col: 0 + width: 24 + height: 5 + - title: Reverse Goal Path + name: Reverse Goal Path + model: ga4 + explore: sessions + type: looker_grid + fields: [events.current_page_minus_1, events.current_page_minus_2, events.current_page_minus_3, + events.event_param_page, events.sessions_with_conversions] + filters: + events.has_completed_goal: 'Yes' + sorts: [events.sessions_with_conversions desc] + limit: 50 + column_limit: 50 + total: true + dynamic_fields: [{table_calculation: of_total_sessions, label: "% of Total Sessions", + expression: "${events.sessions_with_conversions}/${events.sessions_with_conversions:total}", + value_format: !!null '', value_format_name: percent_0, _kind_hint: measure, + _type_hint: number}] + show_view_names: false + show_row_numbers: true + transpose: false + truncate_text: false + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: false + enable_conditional_formatting: true + header_text_alignment: left + header_font_size: '12' + rows_font_size: '12' + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + show_sql_query_menu_options: false + show_totals: false + show_row_totals: true + series_cell_visualizations: + event_data.sessions_with_conversions: + is_active: false + conditional_formatting: [{type: along a scale..., value: !!null '', background_color: "#1A73E8", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab, options: {steps: 5, constraints: { + max: {type: percentile, value: 99}}}}, bold: false, italic: false, strikethrough: false, + fields: [of_total_sessions]}] + x_axis_gridlines: false + y_axis_gridlines: true + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + hidden_fields: [] + y_axes: [] + listen: + 'Goal: Event Name': events.event_name_goal_selection + 'Goal: Event Page': events.page_goal_selection + Audience Selector: sessions.audience_selector + Session Date: sessions.session_date + row: 44 + col: 0 + width: 12 + height: 11 + - title: Reverse Event Action Path + name: Reverse Event Action Path + model: ga4 + explore: sessions + type: looker_grid + fields: [events.current_event_minus_3, events.current_event_minus_2, events.current_event_minus_1, + events.full_event, events.sessions_with_conversions] + filters: + events.has_completed_goal: 'Yes' + sorts: [events.sessions_with_conversions desc] + limit: 50 + column_limit: 50 + total: true + dynamic_fields: [{table_calculation: of_total_sessions, label: "% of Total Sessions", + expression: "${events.sessions_with_conversions}/${events.sessions_with_conversions:total}", + value_format: !!null '', value_format_name: percent_0, _kind_hint: measure, + _type_hint: number}] + show_view_names: false + show_row_numbers: true + transpose: false + truncate_text: false + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: false + enable_conditional_formatting: true + header_text_alignment: left + header_font_size: '12' + rows_font_size: '12' + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + show_sql_query_menu_options: false + show_totals: false + show_row_totals: true + series_cell_visualizations: + event_data.sessions_with_conversions: + is_active: false + conditional_formatting: [{type: along a scale..., value: !!null '', background_color: "#1A73E8", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab, options: {steps: 5, constraints: { + max: {type: percentile, value: 99}}}}, bold: false, italic: false, strikethrough: false, + fields: [of_total_sessions]}] + x_axis_gridlines: false + y_axis_gridlines: true + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + hidden_fields: [] + y_axes: [] + listen: + 'Goal: Event Name': events.event_name_goal_selection + 'Goal: Event Page': events.page_goal_selection + Session Date: sessions.session_date + row: 44 + col: 12 + width: 12 + height: 11 + - name: " (5)" + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t
\n\t\t\n\t

\n\n
" + row: 0 + col: 0 + width: 24 + height: 4 + filters: + - name: Session Date + title: Session Date + type: field_filter + default_value: 7 day + allow_multiple_values: true + required: false + ui_config: + type: relative_timeframes + display: inline + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.session_date + - name: 'Goal: Event Name' + title: 'Goal: Event Name' + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: advanced + display: popover + model: ga4 + explore: sessions + listens_to_filters: [] + field: events.event_name_goal_selection + - name: 'Goal: Event Page' + title: 'Goal: Event Page' + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: advanced + display: popover + model: ga4 + explore: sessions + listens_to_filters: [] + field: events.page_goal_selection + - name: Audience Selector + title: Audience Selector + type: field_filter + default_value: Device + allow_multiple_values: true + required: false + ui_config: + type: dropdown_menu + display: inline + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.audience_selector \ No newline at end of file diff --git a/dashboards/event_funnel.dashboard.lookml b/dashboards/event_funnel.dashboard.lookml new file mode 100644 index 0000000..f4e171c --- /dev/null +++ b/dashboards/event_funnel.dashboard.lookml @@ -0,0 +1,332 @@ +- dashboard: ga4_event_funnel + title: "[GA4] Event Funnel" + layout: newspaper + preferred_viewer: dashboards-next + elements: + - title: Event Funnel + name: Event Funnel + model: ga4 + explore: sessions + type: looker_column + fields: [sessions.audience_trait, sessions.count_of_event_1, sessions.count_of_event_2, + sessions.count_of_event_3, sessions.count_of_event_4, sessions.count_of_event_5, + sessions.count_of_event_6] + sorts: [sessions.count_of_event_1 desc] + limit: 12 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: row + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + series_types: {} + show_dropoff: true + defaults_version: 1 + hidden_fields: [] + y_axes: [] + listen: + Landing Page: sessions.landing_page + Audience Selector: sessions.audience_selector + Event 1: sessions.event_1_filter + Event 2: sessions.event_2_filter + Event 3: sessions.event_3_filter + Event 4: sessions.event_4_filter + Event 5: sessions.event_5_filter + Event 6: sessions.event_6_filter + Goal Event: events.event_name + row: 4 + col: 0 + width: 24 + height: 14 + - name: '' + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t
\n\t\t

GA4 Event Flow Event Funnel

What\ + \ are customers clicking on our site?\n
Recommended Action\U0001f447\ + \ Update the filters above to create your own custom event flow. Alter the audience\ + \ cohort to dynamically view your funnel.

\n
" + row: 0 + col: 0 + width: 24 + height: 4 + - name: " (2)" + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t

Customer Event Flow

What are customers clicking before our conversion event?
\nRecommended\ + \ Action\U0001f447 Use the Goal Event filter at the top to choose a conversion\ + \ event.\n

\n
" + row: 18 + col: 0 + width: 24 + height: 4 + - title: Event Action % of Total Funnel + name: Event Action % of Total Funnel + model: ga4 + explore: sessions + type: looker_column + fields: [sessions.count_of_event_1, sessions.count_of_event_2, sessions.count_of_event_3, + sessions.count_of_event_4, sessions.count_of_event_5, sessions.count_of_event_6] + sorts: [sessions.count_of_event_1 desc] + limit: 12 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + series_types: {} + show_dropoff: true + defaults_version: 1 + hidden_fields: [] + y_axes: [] + listen: + Landing Page: sessions.landing_page + Audience Selector: sessions.audience_selector + Event 1: sessions.event_1_filter + Event 2: sessions.event_2_filter + Event 3: sessions.event_3_filter + Event 4: sessions.event_4_filter + Event 5: sessions.event_5_filter + Event 6: sessions.event_6_filter + Goal Event: events.event_name + row: 22 + col: 0 + width: 24 + height: 8 + - title: Event Flow + name: Event Flow + model: ga4 + explore: sessions + type: looker_grid + fields: [events.event_name, events.current_event_plus_1, events.current_event_plus_2, + events.current_event_plus_3, events.current_event_plus_4, events.current_event_plus_5, + events.current_event_plus_6, sessions.total_sessions] + sorts: [sessions.total_sessions desc] + limit: 12 + show_view_names: false + show_row_numbers: true + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: false + enable_conditional_formatting: false + header_text_alignment: left + header_font_size: 12 + rows_font_size: 12 + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + x_axis_gridlines: false + y_axis_gridlines: true + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + series_types: {} + show_dropoff: true + defaults_version: 1 + hidden_fields: [] + y_axes: [] + listen: + Landing Page: sessions.landing_page + Audience Selector: sessions.audience_selector + Goal Event: events.event_name + row: 30 + col: 0 + width: 24 + height: 7 + filters: + - name: Landing Page + title: Landing Page + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.landing_page + - name: Event 1 + title: Event 1 + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.event_1_filter + - name: Event 2 + title: Event 2 + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.event_2_filter + - name: Event 3 + title: Event 3 + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.event_3_filter + - name: Event 4 + title: Event 4 + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.event_4_filter + - name: Event 5 + title: Event 5 + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.event_5_filter + - name: Event 6 + title: Event 6 + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.event_6_filter + - name: Goal Event + title: Goal Event + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: events.event_name + - name: Audience Selector + title: Audience Selector + type: field_filter + default_value: Device + allow_multiple_values: true + required: false + ui_config: + type: dropdown_menu + display: inline + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.audience_selector \ No newline at end of file diff --git a/dashboards/overview.dashboard.lookml b/dashboards/overview.dashboard.lookml new file mode 100644 index 0000000..491060b --- /dev/null +++ b/dashboards/overview.dashboard.lookml @@ -0,0 +1,1375 @@ +- dashboard: overview + title: "[GA4] Overview" + layout: newspaper + preferred_viewer: dashboards-next + elements: + - title: Session Count + name: Session Count + model: ga4 + explore: sessions + type: single_value + fields: [sessions.total_sessions, sessions.total_first_visit_sessions_percentage] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + color_application: + collection_id: legacy + palette_id: looker_classic + custom_color: "#FFF" + single_value_title: Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + hidden_fields: [] + y_axes: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 8 + col: 0 + width: 6 + height: 4 + - name: '' + type: text + title_text: '' + subtitle_text: '' + body_text: "---\n
\n\t
\n\t\t

GA Overview

\nOverview\ + \ of traffic to website

\n
" + row: 4 + col: 0 + width: 24 + height: 4 + - title: Bounces + name: Bounces + model: ga4 + explore: sessions + type: single_value + fields: [sessions.total_bounced_sessions, sessions.total_bounced_sessions_percentage] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + color_application: + collection_id: legacy + palette_id: looker_classic + custom_color: "#FFF" + single_value_title: Bounces + comparison_label: Bounce Rate + conditional_formatting: [{type: not null, value: !!null '', background_color: "#EA4335", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + hidden_fields: [] + y_axes: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 8 + col: 6 + width: 6 + height: 4 + - title: Avg Session Duration + name: Avg Session Duration + model: ga4 + explore: sessions + type: single_value + fields: [sessions.average_session_duration] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + color_application: + collection_id: legacy + palette_id: looker_classic + custom_color: "#FFF" + single_value_title: Avg Session Duration + comparison_label: Bounce Rate + conditional_formatting: [{type: not null, value: !!null '', background_color: "#1A73E8", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + hidden_fields: [] + y_axes: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 8 + col: 18 + width: 6 + height: 4 + - title: Engaged Sessions + name: Engaged Sessions + model: ga4 + explore: sessions + type: single_value + fields: [sessions.total_engaged_sessions, sessions.total_engaged_sessions_percentage] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + color_application: + collection_id: legacy + palette_id: looker_classic + custom_color: "#FFF" + single_value_title: Engaged Sessions + comparison_label: Engaged Session Percentage + conditional_formatting: [{type: not null, value: !!null '', background_color: "#7CB342", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + hidden_fields: [] + y_axes: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 8 + col: 12 + width: 6 + height: 4 + - title: Traffic + name: Traffic + model: ga4 + explore: sessions + type: looker_column + fields: [sessions.total_sessions, sessions.session_data_session_start_week, sessions.total_bounced_sessions_percentage, + sessions.average_session_duration] + fill_fields: [sessions.session_data_session_start_week] + sorts: [sessions.session_data_session_start_week desc] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: time + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + options: + steps: 5 + y_axes: [{label: '', orientation: left, series: [{axisId: sessions.total_sessions, + id: sessions.total_sessions, name: Total Sessions}], showLabels: true, + showValues: true, unpinAxis: false, tickDensity: default, tickDensityCustom: 5, + type: linear}, {label: !!null '', orientation: right, series: [{axisId: sessions.total_bounced_sessions_percentage, + id: sessions.total_bounced_sessions_percentage, name: Total Bounced Sessions + Percentage}], showLabels: true, showValues: true, unpinAxis: false, + tickDensity: default, tickDensityCustom: 5, type: linear}, {label: !!null '', + orientation: right, series: [{axisId: sessions.average_session_duration, id: sessions.average_session_duration, + name: 'Average Session Duration (HH:MM:SS)'}], showLabels: false, showValues: false, + unpinAxis: false, tickDensity: default, tickDensityCustom: 5, type: linear}] + series_types: + sessions.total_bounced_sessions_percentage: line + sessions.average_session_duration: line + series_colors: + sessions.total_sessions: "#F9AB00" + sessions.average_session_duration: "#1A73E8" + sessions.total_bounced_sessions_percentage: "#12B5CB" + series_labels: + sessions.total_sessions: Sessions + sessions.total_bounced_sessions_percentage: Bounce Rate + sessions.average_session_duration: Avg Session Duration + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + single_value_title: Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 12 + col: 0 + width: 16 + height: 9 + - title: Session Duration Tier + name: Session Duration Tier + model: ga4 + explore: sessions + type: looker_bar + fields: [sessions.session_data_session_duration_tier, sessions.total_sessions] + filters: + sessions.session_data_session_duration_tier: "-Undefined" + sorts: [sessions.session_data_session_duration_tier] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + options: + steps: 5 + y_axes: [{label: '', orientation: left, series: [{axisId: sessions.total_sessions, + id: sessions.total_sessions, name: Total Sessions}], showLabels: true, + showValues: true, unpinAxis: false, tickDensity: default, tickDensityCustom: 5, + type: linear}, {label: !!null '', orientation: right, series: [{axisId: sessions.total_bounced_sessions_percentage, + id: sessions.total_bounced_sessions_percentage, name: Total Bounced Sessions + Percentage}], showLabels: true, showValues: true, unpinAxis: false, + tickDensity: default, tickDensityCustom: 5, type: linear}, {label: !!null '', + orientation: right, series: [{axisId: sessions.average_session_duration, id: sessions.average_session_duration, + name: 'Average Session Duration (HH:MM:SS)'}], showLabels: false, showValues: false, + unpinAxis: false, tickDensity: default, tickDensityCustom: 5, type: linear}] + series_types: {} + series_colors: + sessions.total_sessions: "#1A73E8" + sessions.average_session_duration: "#1A73E8" + sessions.total_bounced_sessions_percentage: "#12B5CB" + series_labels: + sessions.total_sessions: Sessions + sessions.total_bounced_sessions_percentage: Bounce Rate + sessions.average_session_duration: Avg Session Duration + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + single_value_title: Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 12 + col: 16 + width: 8 + height: 9 + - title: Users + name: Users + model: ga4 + explore: sessions + type: single_value + fields: [sessions.total_users, sessions.percentage_returning_users] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + color_application: + collection_id: legacy + palette_id: looker_classic + custom_color: "#FFF" + single_value_title: Total Users + comparison_label: Returning Users + conditional_formatting: [{type: not null, value: !!null '', background_color: "#1A73E8", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + hidden_fields: [] + y_axes: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 25 + col: 0 + width: 24 + height: 4 + - title: Sessions by Continent + name: Sessions by Continent + model: ga4 + explore: sessions + type: looker_area + fields: [sessions.session_data_session_start_week, sessions.total_sessions, sessions.geo_data_continent] + pivots: [sessions.geo_data_continent] + fill_fields: [sessions.session_data_session_start_week] + filters: + sessions.geo_data_continent: -NULL, -"(not set)" + sorts: [sessions.session_data_session_start_week desc] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: percent + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: time + y_axis_combined: true + show_null_points: true + interpolation: linear + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + options: + steps: 5 + y_axes: [{label: '', orientation: left, series: [{axisId: sessions.total_sessions, + id: sessions.total_sessions, name: Total Sessions}], showLabels: true, + showValues: true, unpinAxis: false, tickDensity: default, tickDensityCustom: 5, + type: linear}, {label: !!null '', orientation: right, series: [{axisId: sessions.total_bounced_sessions_percentage, + id: sessions.total_bounced_sessions_percentage, name: Total Bounced Sessions + Percentage}], showLabels: true, showValues: true, unpinAxis: false, + tickDensity: default, tickDensityCustom: 5, type: linear}, {label: !!null '', + orientation: right, series: [{axisId: sessions.average_session_duration, id: sessions.average_session_duration, + name: 'Average Session Duration (HH:MM:SS)'}], showLabels: false, showValues: false, + unpinAxis: false, tickDensity: default, tickDensityCustom: 5, type: linear}] + series_types: {} + series_colors: + sessions.total_sessions: "#F9AB00" + sessions.average_session_duration: "#1A73E8" + sessions.total_bounced_sessions_percentage: "#12B5CB" + series_labels: + sessions.total_sessions: Sessions + sessions.total_bounced_sessions_percentage: Bounce Rate + sessions.average_session_duration: Avg Session Duration + ordering: none + show_null_labels: false + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + single_value_title: Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 29 + col: 0 + width: 9 + height: 8 + - title: Top US States + name: Top US States + model: ga4 + explore: sessions + type: looker_geo_choropleth + fields: [sessions.total_sessions, sessions.geo_data_region] + filters: + sessions.geo_data_country: United States + sorts: [sessions.total_sessions desc] + limit: 500 + column_limit: 50 + map: usa + map_projection: '' + show_view_names: false + quantize_colors: false + colors: ["#f9f9f9", "#4285F4", "#185ABC"] + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + options: + steps: 5 + x_axis_gridlines: false + y_axis_gridlines: true + y_axes: [{label: '', orientation: left, series: [{axisId: sessions.total_sessions, + id: sessions.total_sessions, name: Total Sessions}], showLabels: true, + showValues: true, unpinAxis: false, tickDensity: default, tickDensityCustom: 5, + type: linear}, {label: !!null '', orientation: right, series: [{axisId: sessions.total_bounced_sessions_percentage, + id: sessions.total_bounced_sessions_percentage, name: Total Bounced Sessions + Percentage}], showLabels: true, showValues: true, unpinAxis: false, + tickDensity: default, tickDensityCustom: 5, type: linear}, {label: !!null '', + orientation: right, series: [{axisId: sessions.average_session_duration, id: sessions.average_session_duration, + name: 'Average Session Duration (HH:MM:SS)'}], showLabels: false, showValues: false, + unpinAxis: false, tickDensity: default, tickDensityCustom: 5, type: linear}] + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: percent + limit_displayed_rows: false + legend_position: center + series_types: {} + point_style: none + series_colors: + sessions.total_sessions: "#F9AB00" + sessions.average_session_duration: "#1A73E8" + sessions.total_bounced_sessions_percentage: "#12B5CB" + series_labels: + sessions.total_sessions: Sessions + sessions.total_bounced_sessions_percentage: Bounce Rate + sessions.average_session_duration: Avg Session Duration + show_value_labels: false + label_density: 25 + x_axis_scale: time + y_axis_combined: true + show_null_points: true + interpolation: linear + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + ordering: none + show_null_labels: false + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + single_value_title: Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + map_plot_mode: points + heatmap_gridlines: false + heatmap_gridlines_empty: false + heatmap_opacity: 0.5 + show_region_field: true + draw_map_labels_above_data: true + map_tile_provider: light + map_position: custom + map_scale_indicator: 'off' + map_pannable: true + map_zoomable: true + map_marker_type: circle + map_marker_icon_name: default + map_marker_radius_mode: proportional_value + map_marker_units: meters + map_marker_proportional_scale_type: linear + map_marker_color_mode: fixed + show_legend: true + quantize_map_value_colors: false + reverse_map_value_colors: false + map_latitude: 36.94989178681327 + map_longitude: -91.142578125 + map_zoom: 3 + hidden_fields: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 29 + col: 9 + width: 7 + height: 8 + - title: Top Countries (Non-US) + name: Top Countries (Non-US) + model: ga4 + explore: sessions + type: looker_geo_choropleth + fields: [sessions.total_sessions, sessions.geo_data_country] + filters: + sessions.geo_data_country: "-United States" + sorts: [sessions.total_sessions desc] + limit: 500 + column_limit: 50 + map: world + map_projection: '' + show_view_names: false + quantize_colors: false + colors: ["#f9f9f9", "#4285F4", "#185ABC"] + color_application: + collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2 + palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1 + options: + steps: 5 + x_axis_gridlines: false + y_axis_gridlines: true + y_axes: [{label: '', orientation: left, series: [{axisId: sessions.total_sessions, + id: sessions.total_sessions, name: Total Sessions}], showLabels: true, + showValues: true, unpinAxis: false, tickDensity: default, tickDensityCustom: 5, + type: linear}, {label: !!null '', orientation: right, series: [{axisId: sessions.total_bounced_sessions_percentage, + id: sessions.total_bounced_sessions_percentage, name: Total Bounced Sessions + Percentage}], showLabels: true, showValues: true, unpinAxis: false, + tickDensity: default, tickDensityCustom: 5, type: linear}, {label: !!null '', + orientation: right, series: [{axisId: sessions.average_session_duration, id: sessions.average_session_duration, + name: 'Average Session Duration (HH:MM:SS)'}], showLabels: false, showValues: false, + unpinAxis: false, tickDensity: default, tickDensityCustom: 5, type: linear}] + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: percent + limit_displayed_rows: false + legend_position: center + series_types: {} + point_style: none + series_colors: + sessions.total_sessions: "#F9AB00" + sessions.average_session_duration: "#1A73E8" + sessions.total_bounced_sessions_percentage: "#12B5CB" + series_labels: + sessions.total_sessions: Sessions + sessions.total_bounced_sessions_percentage: Bounce Rate + sessions.average_session_duration: Avg Session Duration + show_value_labels: false + label_density: 25 + x_axis_scale: time + y_axis_combined: true + show_null_points: true + interpolation: linear + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + ordering: none + show_null_labels: false + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + single_value_title: Sessions + comparison_label: First Visit Sessions + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + map_plot_mode: points + heatmap_gridlines: false + heatmap_gridlines_empty: false + heatmap_opacity: 0.5 + show_region_field: true + draw_map_labels_above_data: true + map_tile_provider: light + map_position: custom + map_scale_indicator: 'off' + map_pannable: true + map_zoomable: true + map_marker_type: circle + map_marker_icon_name: default + map_marker_radius_mode: proportional_value + map_marker_units: meters + map_marker_proportional_scale_type: linear + map_marker_color_mode: fixed + show_legend: true + quantize_map_value_colors: false + reverse_map_value_colors: false + map_latitude: 36.94989178681327 + map_longitude: -91.142578125 + map_zoom: 3 + hidden_fields: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 29 + col: 16 + width: 8 + height: 8 + - title: Sessions by Source Channel + name: Sessions by Source Channel + model: ga4 + explore: sessions + type: looker_bar + fields: [sessions.audience_trait, sessions.total_sessions, audience_cohorts.rank] + pivots: [sessions.audience_trait, audience_cohorts.rank] + filters: + sessions.audience_selector: Channel + sorts: [audience_cohorts.rank, sessions.audience_trait] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: percent + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + series_types: {} + defaults_version: 1 + hidden_fields: [] + y_axes: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 41 + col: 0 + width: 24 + height: 7 + - title: Top Referrers + name: Top Referrers + model: ga4 + explore: sessions + type: looker_bar + fields: [sessions.session_attribution_source, sessions.total_sessions] + filters: + sessions.session_attribution_medium: referral + sorts: [sessions.total_sessions desc] + limit: 500 + column_limit: 50 + dynamic_fields: [{table_calculation: of_total, label: "% of Total", expression: "${sessions.total_sessions}/sum(${sessions.total_sessions})", + value_format: !!null '', value_format_name: percent_0, _kind_hint: measure, + _type_hint: number}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: true + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + limit_displayed_rows_values: + show_hide: show + first_last: first + num_rows: '10' + hidden_series: [of_total] + series_types: {} + series_colors: + sessions.total_sessions: "#F9AB00" + of_total: "#facb04" + defaults_version: 1 + hidden_fields: [] + y_axes: [] + note_state: collapsed + note_display: hover + note_text: Channel groups are default, as defined by Google https://support.google.com/analytics/answer/9756891?hl=en + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 48 + col: 0 + width: 12 + height: 11 + - title: Top Landing Pages + name: Top Landing Pages + model: ga4 + explore: sessions + type: looker_bar + fields: [sessions.total_sessions, events.event_param_page] + filters: + events.event_param_page: "-EMPTY" + events.page_view_rank: '1' + sorts: [sessions.total_sessions desc] + limit: 500 + column_limit: 50 + dynamic_fields: [{table_calculation: of_total, label: "% of Total", expression: "${sessions.total_sessions}/sum(${sessions.total_sessions})", + value_format: !!null '', value_format_name: percent_0, _kind_hint: measure, + _type_hint: number}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: true + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + limit_displayed_rows_values: + show_hide: show + first_last: first + num_rows: '10' + hidden_series: [of_total] + series_types: {} + series_colors: + sessions.total_sessions: "#F9AB00" + of_total: "#facb04" + defaults_version: 1 + hidden_fields: [] + y_axes: [] + note_state: collapsed + note_display: hover + note_text: Top 10 Landing pages based on Sessions within timeframe + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 48 + col: 12 + width: 12 + height: 11 + - title: Page Views + name: Page Views + model: ga4 + explore: sessions + type: single_value + fields: [events.total_page_views, events.total_unique_page_views] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + comparison_label: Unique Page Views + conditional_formatting: [{type: not null, value: !!null '', background_color: "#c73727", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + series_types: {} + hidden_fields: [] + y_axes: [] + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 63 + col: 0 + width: 12 + height: 4 + - title: Average Time on Page + name: Average Time on Page + model: ga4 + explore: sessions + type: single_value + fields: [events.average_time_to_next_page] + sorts: [events.average_time_to_next_page desc] + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + single_value_title: Avg Time on Page + conditional_formatting: [{type: not null, value: !!null '', background_color: "#1A73E8", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: [] + y_axes: [] + note_state: collapsed + note_display: hover + note_text: Avg time spent on each page in session + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 63 + col: 12 + width: 12 + height: 4 + - title: Top Pages + name: Top Pages + model: ga4 + explore: sessions + type: looker_bar + fields: [events.total_page_views, events.total_unique_page_views, events.event_param_page] + filters: + events.event_param_page: "-EMPTY" + sorts: [events.total_page_views desc] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: false + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: true + legend_position: center + point_style: circle + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + y_axes: [{label: '', orientation: bottom, series: [{axisId: events.total_page_views, + id: events.total_page_views, name: Total Page Views}, {axisId: events.total_unique_page_views, + id: events.total_unique_page_views, name: Total Unique Page Views}], showLabels: false, + showValues: false, unpinAxis: false, tickDensity: default, tickDensityCustom: 5, + type: linear}] + size_by_field: event_data.total_unique_page_views + limit_displayed_rows_values: + show_hide: show + first_last: first + num_rows: '10' + series_types: + events.total_unique_page_views: scatter + series_colors: + events.total_page_views: "#B31412" + events.total_unique_page_views: "#BDC1C6" + label_color: ["#B31412", transparent] + custom_color_enabled: true + show_single_value_title: true + show_comparison: true + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#FFF" + comparison_label: Unique Page Views + conditional_formatting: [{type: not null, value: !!null '', background_color: "#c73727", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: [] + note_state: collapsed + note_display: hover + note_text: Top Pages based on Page Views within timeframe + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 67 + col: 0 + width: 12 + height: 12 + - title: Average Time by Page + name: Average Time by Page + model: ga4 + explore: sessions + type: looker_bar + fields: [events.event_param_page, events.average_time_to_next_page, events.total_page_views] + filters: + events.event_param_page: "-EMPTY" + sorts: [events.total_page_views desc] + limit: 500 + column_limit: 50 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: true + legend_position: center + point_style: none + show_value_labels: true + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + y_axes: [{label: '', orientation: bottom, series: [{axisId: events.average_time_to_next_page, + id: events.average_time_to_next_page, name: Average Time to Next Event}], + showLabels: false, showValues: false, unpinAxis: false, tickDensity: default, + tickDensityCustom: 5, type: linear}] + limit_displayed_rows_values: + show_hide: show + first_last: first + num_rows: '10' + series_types: {} + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + single_value_title: Avg Time on Page + conditional_formatting: [{type: not null, value: !!null '', background_color: "#1A73E8", + font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2, + palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false, + strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_fields: [events.total_page_views] + note_state: collapsed + note_display: hover + note_text: Avg time spent on each page in session + listen: + Date: sessions.session_date + Landing Page: sessions.landing_page + row: 67 + col: 12 + width: 12 + height: 12 + - name: " (2)" + type: text + title_text: '' + subtitle_text: '' + body_text: "---\n
\n\t
\n\t\t

Behavior\n

What are people\ + \ doing on your website?\n

\n
" + row: 59 + col: 0 + width: 24 + height: 4 + - name: " (3)" + type: text + title_text: '' + subtitle_text: '' + body_text: "---\n
\n\t
\n\t\t

Audience

Who is visiting\ + \ your website?

\n
" + row: 21 + col: 0 + width: 24 + height: 4 + - name: " (4)" + type: text + title_text: '' + subtitle_text: '' + body_text: "---\n
\n\t
\n\t\t

Acquisition\n

How are\ + \ people finding you?

\n
" + row: 37 + col: 0 + width: 24 + height: 4 + - name: " (5)" + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t
\n\t\t\n\t

\n\n
" + row: 0 + col: 0 + width: 24 + height: 4 + filters: + - name: Date + title: Date + type: field_filter + default_value: 14 day + allow_multiple_values: true + required: false + ui_config: + type: relative_timeframes + display: inline + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.session_date + - name: Landing Page + title: Landing Page + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.landing_page \ No newline at end of file diff --git a/dashboards/page_funnel.dashboard.lookml b/dashboards/page_funnel.dashboard.lookml new file mode 100644 index 0000000..0d017ab --- /dev/null +++ b/dashboards/page_funnel.dashboard.lookml @@ -0,0 +1,344 @@ + +- dashboard: ga4_page_funnel + title: "[GA4] Page Funnel" + layout: newspaper + preferred_viewer: dashboards-next + elements: + - title: Page Funnel + name: Page Funnel + model: ga4 + explore: sessions + type: looker_column + fields: [sessions.audience_trait, sessions.count_of_page_1, sessions.count_of_page_2, + sessions.count_of_page_3, sessions.count_of_page_4, sessions.count_of_page_5, + sessions.count_of_page_6] + limit: 12 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: row + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + series_types: {} + show_dropoff: true + defaults_version: 1 + hidden_fields: [] + y_axes: [] + listen: + Session Date: sessions.session_date + Host Name: events.event_param_host + Audience Selector: sessions.audience_selector + Page 3: sessions.page_3_filter + Page 2: sessions.page_2_filter + Page 1: sessions.page_1_filter + Page 4: sessions.page_4_filter + Page 5: sessions.page_5_filter + Page 6: sessions.page_6_filter + row: 4 + col: 0 + width: 24 + height: 14 + - name: '' + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t
\n\t\t

GA4 Page Pathing Page Funnel

How\ + \ are customers moving through our site?
Recommended Action\U0001f447\ + Update the filters above to create your own custom path pathing funnel. Then\ + \ link from any page in the funnel to see what actions occur on that page.

\n\ +
" + row: 0 + col: 0 + width: 24 + height: 4 + - name: " (2)" + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t

Page Path Funnel

How\ + \ are people moving through the website as a % of Total
\nRecommended\ + \ Action\U0001f447 Use the page filters at the top to define the different\ + \ steps in the funnel.\n

\n
" + row: 18 + col: 0 + width: 24 + height: 4 + - title: Page Path Funnel % of Total + name: Page Path Funnel % of Total + model: ga4 + explore: sessions + type: looker_column + fields: [sessions.count_of_page_1, sessions.count_of_page_2, sessions.count_of_page_3, + sessions.count_of_page_4, sessions.count_of_page_5, sessions.count_of_page_6] + limit: 12 + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + series_types: {} + show_dropoff: true + defaults_version: 1 + hidden_fields: [] + y_axes: [] + listen: + Session Date: sessions.session_date + Host Name: events.event_param_host + Audience Selector: sessions.audience_selector + Page 3: sessions.page_3_filter + Page 2: sessions.page_2_filter + Page 1: sessions.page_1_filter + Page 4: sessions.page_4_filter + Page 5: sessions.page_5_filter + Page 6: sessions.page_6_filter + row: 22 + col: 0 + width: 24 + height: 8 + - title: Top Page Paths + name: Top Page Paths + model: ga4 + explore: sessions + type: looker_grid + fields: [sessions.total_sessions, events.event_param_page, events.current_page_plus_1, + events.current_page_plus_2, events.current_page_plus_3, events.current_page_plus_4, + events.current_page_plus_5, events.current_page_plus_6] + sorts: [sessions.total_sessions desc] + limit: 12 + show_view_names: false + show_row_numbers: true + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: false + enable_conditional_formatting: false + header_text_alignment: left + header_font_size: 12 + rows_font_size: 12 + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + x_axis_gridlines: false + y_axis_gridlines: true + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + series_types: {} + show_dropoff: true + defaults_version: 1 + hidden_fields: [] + y_axes: [] + listen: + Session Date: sessions.session_date + Host Name: events.event_param_host + Audience Selector: sessions.audience_selector + row: 34 + col: 0 + width: 24 + height: 7 + - name: " (3)" + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t

Natural Page Path

How\ + \ are users naturally flowing through the site?
\nRecommended Action\U0001f447\ + \ Drill in to see the breakdown by source medium.\n

\n
" + row: 30 + col: 0 + width: 24 + height: 4 + filters: + - name: Session Date + title: Session Date + type: field_filter + default_value: 7 day + allow_multiple_values: true + required: false + ui_config: + type: relative_timeframes + display: inline + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.session_date + - name: Host Name + title: Host Name + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: events.event_param_host + - name: Page 1 + title: Page 1 + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.page_1_filter + - name: Page 2 + title: Page 2 + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.page_2_filter + - name: Page 3 + title: Page 3 + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.page_3_filter + - name: Page 4 + title: Page 4 + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.page_4_filter + - name: Page 5 + title: Page 5 + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.page_5_filter + - name: Page 6 + title: Page 6 + type: field_filter + default_value: '' + allow_multiple_values: true + required: false + ui_config: + type: tag_list + display: popover + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.page_6_filter + - name: Audience Selector + title: Audience Selector + type: field_filter + default_value: Device + allow_multiple_values: true + required: false + ui_config: + type: dropdown_menu + display: inline + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.audience_selector \ No newline at end of file diff --git a/dashboards/performance_metrics_model.dashboard.lookml b/dashboards/performance_metrics_model.dashboard.lookml new file mode 100644 index 0000000..82c593f --- /dev/null +++ b/dashboards/performance_metrics_model.dashboard.lookml @@ -0,0 +1,388 @@ +- dashboard: ga4_bqml_performance_metrics + title: "[GA4] BQML Performance Metrics" + layout: newspaper + preferred_viewer: dashboards-next + description: '' + preferred_slug: yV1lddKlXNKrve0xKnZHKx + elements: + - name: " (3)" + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t
\n\t\t\n\t

\n\n
" + row: 0 + col: 0 + width: 24 + height: 4 + - name: " (4)" + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t
\n\n
" + row: 0 + col: 0 + width: 20 + height: 2 + + + + - title: Model Performance Metrics + name: Model Performance Metrics + model: ga4 + explore: future_purchase_model_evaluation + type: looker_grid + fields: [future_purchase_model_evaluation.accuracy, future_purchase_model_evaluation.f1_score, + future_purchase_model_evaluation.recall, future_purchase_model_evaluation.log_loss, + future_purchase_model_evaluation.roc_auc] + sorts: [future_purchase_model_evaluation.accuracy] + limit: 500 + column_limit: 50 + show_view_names: false + show_row_numbers: true + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: false + enable_conditional_formatting: true + header_text_alignment: left + header_font_size: '12' + rows_font_size: '12' + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + color_application: + collection_id: legacy + palette_id: looker_classic + show_sql_query_menu_options: false + show_totals: true + show_row_totals: true + truncate_header: false + minimum_column_width: 75 + series_text_format: + future_purchase_model_evaluation.accuracy: + bg_color: "#39ff1c" + conditional_formatting: [{type: along a scale..., value: !!null '', background_color: "#62bad4", + font_color: !!null '', color_application: {collection_id: legacy, palette_id: legacy_diverging2, + options: {steps: 5}}, bold: false, italic: false, strikethrough: false, + fields: !!null ''}] + series_value_format: + future_purchase_model_evaluation.log_loss: + name: percent_3 + decimals: '3' + format_string: "#,##0.000%" + label: Percent (3) + label_prefix: Percent + future_purchase_model_evaluation.roc_auc: + name: percent_3 + decimals: '3' + format_string: "#,##0.000%" + label: Percent (3) + label_prefix: Percent + hidden_fields: [] + hidden_points_if_no: [] + theme: traditional + layout: fixed + minWidthForIndexColumns: true + showTooltip: false + showHighlight: false + columnOrder: {} + defaults_version: 1 + y_axes: [] + listen: {} + row: 6 + col: 8 + width: 14 + height: 4 + - title: Training Iterations + name: Training Iterations + model: ga4 + explore: future_purchase_model_training_info + type: looker_grid + fields: [future_purchase_model_training_info.duration_ms, future_purchase_model_training_info.eval_loss, + future_purchase_model_training_info.iteration, future_purchase_model_training_info.learning_rate, + future_purchase_model_training_info.training_run] + sorts: [future_purchase_model_training_info.duration_ms] + limit: 500 + column_limit: 50 + show_view_names: false + show_row_numbers: true + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: false + enable_conditional_formatting: false + header_text_alignment: left + header_font_size: 12 + rows_font_size: 12 + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + defaults_version: 1 + y_axes: [] + listen: {} + row: 13 + col: 0 + width: 22 + height: 4 + - title: Confusion Matrix + name: Confusion Matrix + model: ga4 + explore: confusion_matrix + type: marketplace_viz_report_table::report_table-marketplace + fields: [confusion_matrix.Expected_label, confusion_matrix.Predicted_0, confusion_matrix.Predicted_1] + sorts: [confusion_matrix.Expected_label] + limit: 500 + column_limit: 50 + dynamic_fields: + - args: + - confusion_matrix.Predicted_1 + calculation_type: percent_of_column_sum + category: table_calculation + based_on: confusion_matrix.Predicted_1 + label: Percent of Confusion Matrix Predicted 1 + source_field: confusion_matrix.Predicted_1 + table_calculation: percent_of_confusion_matrix_predicted_1 + value_format: + value_format_name: percent_0 + _kind_hint: dimension + _type_hint: number + is_disabled: true + hidden_fields: [] + hidden_points_if_no: [] + show_view_names: false + theme: traditional + customTheme: '' + layout: auto + minWidthForIndexColumns: true + headerFontSize: 12 + bodyFontSize: 12 + showTooltip: true + showHighlight: true + columnOrder: {} + rowSubtotals: false + colSubtotals: false + spanRows: true + spanCols: true + calculateOthers: true + sortColumnsBy: pivots + useViewName: false + useHeadings: false + useShortName: false + useUnit: false + groupVarianceColumns: false + genericLabelForSubtotals: false + indexColumn: false + transposeTable: false + label|confusion_matrix.Expected_label: Expected Label + heading|confusion_matrix.Expected_label: '' + hide|confusion_matrix.Expected_label: false + label|confusion_matrix.Predicted_0: Predicted 0 + heading|confusion_matrix.Predicted_0: '' + hide|confusion_matrix.Predicted_0: false + label|confusion_matrix.Predicted_1: Predicted 1 + heading|confusion_matrix.Predicted_1: '' + hide|confusion_matrix.Predicted_1: false + subtotalDepth: '1' + show_row_numbers: true + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: false + enable_conditional_formatting: false + header_text_alignment: left + header_font_size: 12 + rows_font_size: 12 + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + hidden_pivots: {} + defaults_version: 0 + truncate_column_names: false + y_axes: [] + listen: {} + row: 2 + col: 8 + width: 14 + height: 4 + - title: Feature Importance + name: Feature Importance + model: ga4 + explore: feature_importance + type: looker_grid + fields: [feature_importance.feature, feature_importance.attribution] + sorts: [feature_importance.attribution desc] + limit: 500 + column_limit: 50 + query_timezone: America/Ciudad_Juarez + show_view_names: false + show_row_numbers: true + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: false + enable_conditional_formatting: true + header_text_alignment: left + header_font_size: '12' + rows_font_size: '12' + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + color_application: + collection_id: legacy + palette_id: looker_classic + show_sql_query_menu_options: false + show_totals: true + show_row_totals: true + truncate_header: false + minimum_column_width: 75 + conditional_formatting: [{type: along a scale..., value: !!null '', background_color: "#62bad4", + font_color: !!null '', color_application: {collection_id: legacy, palette_id: legacy_diverging2, + options: {steps: 5, reverse: false}}, bold: false, italic: false, strikethrough: false, + fields: !!null ''}] + x_axis_gridlines: false + y_axis_gridlines: true + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: true + y_axis_reversed: false + plot_size_by_field: false + x_axis_zoom: true + y_axis_zoom: true + trellis: '' + stacking: normal + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + hidden_fields: [] + hidden_points_if_no: [] + leftAxisLabelVisible: false + leftAxisLabel: '' + rightAxisLabelVisible: false + rightAxisLabel: '' + smoothedBars: false + orientation: automatic + labelPosition: left + percentType: total + percentPosition: inline + valuePosition: right + labelColorEnabled: false + labelColor: "#FFF" + up_color: false + down_color: false + total_color: false + y_axes: [] + listen: {} + row: 2 + col: 0 + width: 8 + height: 11 + - type: button + name: button_1013 + rich_content_json: '{"text":"Go to top","description":"This button is for redirecting + back to the top of the page","newTab":false,"alignment":"center","size":"medium","style":"FILLED","color":"#1A73E8","href":"#top"}' + row: 17 + col: 0 + width: 24 + height: 1 + - name: " (Copy)" + type: text + title_text: " (Copy)" + subtitle_text: '' + body_text: '[{"type":"h1","children":[{"text":"Propensity Model Details"}],"align":"center"}]' + rich_content_json: '{"format":"slate"}' + row: 0 + col: 0 + width: 22 + height: 2 + filters: + - name: Session Date + title: Session Date + type: field_filter + default_value: 90 day + allow_multiple_values: true + required: true + ui_config: + type: relative_timeframes + display: inline + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.session_date \ No newline at end of file diff --git a/dashboards/propensity_model.dashboard.lookml b/dashboards/propensity_model.dashboard.lookml new file mode 100644 index 0000000..209697b --- /dev/null +++ b/dashboards/propensity_model.dashboard.lookml @@ -0,0 +1,444 @@ +- dashboard: propensity_model + title: "[GA4] Propensity Model" + layout: newspaper + preferred_viewer: dashboards-next + description: '' + preferred_slug: 0CHozsw7cHwlmrT9MKujag + elements: + - name: " (3)" + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t
\n\t\t\n\t

\n\n
" + row: 0 + col: 0 + width: 24 + height: 4 + - name: " (4)" + type: text + title_text: '' + subtitle_text: '' + body_text: "
\n\t
\n\n
" + row: 0 + col: 0 + width: 20 + height: 2 + - type: button + name: button_984 + rich_content_json: '{"text":"Go to top","description":"This button is for redirecting + back to the top of the page","newTab":false,"alignment":"center","size":"medium","style":"FILLED","color":"#1A73E8","href":"#top"}' + row: 37 + col: 0 + width: 24 + height: 1 + - name: '' + type: text + title_text: '' + subtitle_text: '' + body_text: '[{"type":"h1","children":[{"text":"Prediction Statistics"}],"align":"center"}]' + rich_content_json: '{"format":"slate"}' + row: 0 + col: 0 + width: 22 + height: 2 + - title: Prediction Split by Revenue (USD) + name: Prediction Split by Revenue (USD) + model: ga4 + explore: sessions + type: looker_grid + fields: [future_purchase_prediction.pred_probability_bucket, purchase_average_usd, + events.total_purchase_revenue_usd, future_purchase_prediction.count] + fill_fields: [future_purchase_prediction.pred_probability_bucket] + filters: + future_purchase_prediction.user_pseudo_id: NOT NULL + sorts: [future_purchase_prediction.pred_probability_bucket desc] + limit: 500 + column_limit: 50 + dynamic_fields: + - measure: sum_of_ecommerce_purchase_revenue_in_usd + based_on: events.ecommerce__purchase_revenue_in_usd + expression: '' + label: Sum of Ecommerce Purchase Revenue In USD + type: sum + _kind_hint: measure + _type_hint: number + - category: measure + expression: '' + label: Purchase Average (USD) + based_on: events.ecommerce__purchase_revenue_in_usd + _kind_hint: measure + measure: purchase_average_usd + type: average + _type_hint: number + query_timezone: America/Ciudad_Juarez + show_view_names: false + show_row_numbers: true + transpose: false + truncate_text: true + hide_totals: false + hide_row_totals: false + size_to_fit: true + table_theme: white + limit_displayed_rows: false + enable_conditional_formatting: false + header_text_alignment: left + header_font_size: '12' + rows_font_size: '12' + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + show_sql_query_menu_options: false + show_totals: true + show_row_totals: true + truncate_header: false + minimum_column_width: 75 + series_labels: + future_purchase_prediction.pred_probability_bucket: Probability Bucket + series_cell_visualizations: + purchase_average_usd: + is_active: true + palette: + palette_id: 6a5ea9e4-0c4e-7ef3-7e2d-e03007a150eb + collection_id: test + custom_colors: + - "#F9AB00" + - "#B31412" + - "#1A73E8" + events.total_purchase_revenue_usd: + is_active: false + palette: + palette_id: d93e9311-ec5a-f320-de6e-a1d6d68ecfc9 + collection_id: test + custom_colors: + - "#F9AB00" + - "#1A73E8" + - "#B31412" + hidden_pivots: {} + x_axis_gridlines: false + y_axis_gridlines: true + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: true + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + listen: + Session Date: sessions.session_date + row: 4 + col: 0 + width: 22 + height: 4 + - title: Low Prob user_ids + name: Low Prob user_ids + model: ga4 + explore: sessions + type: single_value + fields: [future_purchase_prediction.count] + filters: + future_purchase_prediction.pred_probability_bucket: "< 0.1,>= 0.1 and < 0.2,>= 0.2 and < 0.3" + events.total_purchase_revenue_usd: NOT NULL + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + single_value_title: 2nd Decile + conditional_formatting: [{type: not null, value: !!null '', background_color: "#B31412", + font_color: !!null '', color_application: {collection_id: test, palette_id: test-sequential-0}, + bold: false, italic: false, strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_pivots: {} + listen: + Session Date: sessions.session_date + row: 2 + col: 15 + width: 7 + height: 2 + - title: Medium Prob cust_ids + name: Medium Prob cust_ids + model: ga4 + explore: sessions + type: single_value + fields: [future_purchase_prediction.count] + filters: + future_purchase_prediction.pred_probability_bucket: ">= 0.3 and < 0.4,>= 0.4 and < 0.5,>= 0.5 and < 0.6,>= 0.6 and < 0.7" + events.total_purchase_revenue_usd: NOT NULL + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + single_value_title: 5th Decile + conditional_formatting: [{type: not null, value: !!null '', background_color: "#1A73E8", + font_color: !!null '', color_application: {collection_id: test, palette_id: test-sequential-0}, + bold: false, italic: false, strikethrough: false, fields: !!null ''}] + defaults_version: 1 + hidden_pivots: {} + listen: + Session Date: sessions.session_date + row: 2 + col: 8 + width: 7 + height: 2 + - title: High Prob cust_ids + name: High Prob cust_ids + model: ga4 + explore: sessions + type: single_value + fields: [future_purchase_prediction.count] + filters: + future_purchase_prediction.pred_probability_bucket: ">= 0.7 and < 0.8,>= 0.8 and < 0.9,>= 0.9" + events.total_purchase_revenue_usd: NOT NULL + limit: 500 + column_limit: 50 + custom_color_enabled: true + show_single_value_title: true + show_comparison: false + comparison_type: value + comparison_reverse_colors: false + show_comparison_label: true + enable_conditional_formatting: true + conditional_formatting_include_totals: false + conditional_formatting_include_nulls: false + custom_color: "#fcf9ff" + single_value_title: 7th Decile + conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00", + font_color: "#ffff", color_application: {collection_id: test, palette_id: test-sequential-0}, + bold: false, italic: false, strikethrough: false, fields: !!null ''}] + defaults_version: 1 + listen: + Session Date: sessions.session_date + row: 2 + col: 0 + width: 8 + height: 2 + - title: Rolling 90 day Person Count by Predicted Bucket Across Weeks + name: Rolling 90 day Person Count by Predicted Bucket Across Weeks + model: ga4 + explore: incremental_prediction + type: looker_line + fields: [incremental_prediction.week, incremental_prediction.pred_probability_bucket, + incremental_prediction.count] + pivots: [incremental_prediction.pred_probability_bucket] + sorts: [incremental_prediction.pred_probability_bucket, incremental_prediction.week, + incremental_prediction.count desc 0] + limit: 500 + column_limit: 50 + query_timezone: America/Ciudad_Juarez + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + show_null_points: true + interpolation: linear + color_application: + collection_id: b43731d5-dc87-4a8e-b807-635bef3948e7 + palette_id: fb7bb53e-b77b-4ab6-8274-9d420d3d73f3 + options: + steps: 5 + y_axes: [{label: Person Count, orientation: left, series: [{axisId: incremental_prediction.count, + id: High - incremental_prediction.count, name: High}, {axisId: incremental_prediction.count, + id: Low - incremental_prediction.count, name: Low}, {axisId: incremental_prediction.count, + id: Medium - incremental_prediction.count, name: Medium}], showLabels: true, + showValues: true, unpinAxis: false, tickDensity: default, tickDensityCustom: 5, + type: linear}] + x_axis_zoom: true + y_axis_zoom: true + hide_legend: false + swap_axes: false + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + hidden_fields: [] + hidden_points_if_no: [] + hidden_pivots: {} + listen: {} + row: 8 + col: 0 + width: 22 + height: 6 + - title: Rolling 90 day Revenue (USD) by Predicted Bucket Across Weeks + name: Rolling 90 day Revenue (USD) by Predicted Bucket Across Weeks + model: ga4 + explore: incremental_prediction + type: looker_line + fields: [incremental_prediction.week, incremental_prediction.pred_probability_bucket, + incremental_prediction.total_purchase_revenue_usd] + pivots: [incremental_prediction.pred_probability_bucket] + sorts: [incremental_prediction.pred_probability_bucket, incremental_prediction.week] + limit: 500 + column_limit: 50 + query_timezone: America/Ciudad_Juarez + x_axis_gridlines: false + y_axis_gridlines: true + show_view_names: false + show_y_axis_labels: true + show_y_axis_ticks: true + y_axis_tick_density: default + y_axis_tick_density_custom: 5 + show_x_axis_label: false + show_x_axis_ticks: true + y_axis_scale_mode: linear + x_axis_reversed: false + y_axis_reversed: false + plot_size_by_field: false + trellis: '' + stacking: '' + limit_displayed_rows: false + legend_position: center + point_style: none + show_value_labels: false + label_density: 25 + x_axis_scale: auto + y_axis_combined: true + show_null_points: true + interpolation: linear + color_application: + collection_id: b43731d5-dc87-4a8e-b807-635bef3948e7 + palette_id: fb7bb53e-b77b-4ab6-8274-9d420d3d73f3 + options: + steps: 5 + y_axes: [{label: Revenue (USD), orientation: left, series: [{axisId: incremental_prediction.count, + id: High - incremental_prediction.count, name: High}, {axisId: incremental_prediction.count, + id: Low - incremental_prediction.count, name: Low}, {axisId: incremental_prediction.count, + id: Medium - incremental_prediction.count, name: Medium}], showLabels: true, + showValues: true, unpinAxis: false, tickDensity: default, tickDensityCustom: 5, + type: linear}] + x_axis_zoom: true + y_axis_zoom: true + hide_legend: false + swap_axes: false + ordering: none + show_null_labels: false + show_totals_labels: false + show_silhouette: false + totals_color: "#808080" + defaults_version: 1 + hidden_fields: [] + hidden_points_if_no: [] + hidden_pivots: {} + listen: {} + row: 14 + col: 0 + width: 22 + height: 6 + filters: + - name: Session Date + title: Session Date + type: field_filter + default_value: 90 day + allow_multiple_values: true + required: true + ui_config: + type: relative_timeframes + display: inline + options: [] + model: ga4 + explore: sessions + listens_to_filters: [] + field: sessions.session_date \ No newline at end of file diff --git a/explores/.gitkeep b/explores/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/explores/sessions.explore.lkml b/explores/sessions.explore.lkml new file mode 100644 index 0000000..b0e3e5f --- /dev/null +++ b/explores/sessions.explore.lkml @@ -0,0 +1,127 @@ +include: "/views/*.view.lkml" +include: "/views/*/*.view.lkml" +include: "/views/*/*/*.view.lkml" +include: "/attributes/*.lkml" + +explore: sessions { + label: "GA4 Sessions Beta" + description: "Explores Google Analytics sessions data." + + join: audience_cohorts { + type: left_outer + sql_on: ${sessions.audience_trait} = ${audience_cohorts.audience_trait} ;; + relationship: many_to_one + } + + join: events { + view_label: "Events" + sql: LEFT JOIN UNNEST(${sessions.event_data}) as events with offset as event_row ;; + relationship: one_to_many + } + + join: event_data_items { + view_label: "Events" + sql: LEFT JOIN UNNEST(${events.items}) as event_data_items ;; + relationship: one_to_many + required_joins: [events] + } + + join: user_previous_session { + view_label: "GA4 Sessions" + sql_on: ${sessions.sl_key} = ${user_previous_session.sl_key} ;; + relationship: one_to_one + } + join: user_first_session { + view_label: "GA4 Sessions" + sql_on: ${sessions.sl_key} = ${user_first_session.sl_key} ;; + relationship: one_to_one + } + + join: user_segment { + type: left_outer + sql_on: ${sessions.user_pseudo_id} = ${user_segment.user_pseudo_id} ;; + relationship: many_to_one + } + + join: future_purchase_prediction { + view_label: "Propensity to Purchase" + relationship: one_to_one + # sql_on: ${sessions.sl_key} = ${future_purchase_prediction.sl_key} ;; + sql_on: ${sessions.user_pseudo_id} = ${future_purchase_prediction.user_pseudo_id} ;; + } + + join: paid_shopping { + fields: [] + sql_on: ${sessions.session_attribution_source}=${paid_shopping.channel} + or REGEXP_CONTAINS(${sessions.session_attribution_campaign}, r"^(.*(([^a-df-z]|^)shop|shopping).*)$") = true + and REGEXP_CONTAINS(${sessions.session_attribution_medium}, r"^(.*cp.*|ppc|paid.*)$") = true;; + relationship: many_to_one + } + join: paid_social { + fields: [] + sql_on: ${sessions.session_attribution_source}=${paid_social.channel} and + REGEXP_CONTAINS(${sessions.session_attribution_medium}, r"^(.*cp.*|ppc|paid.*)$") = true ;; + relationship: many_to_one + } + + join: paid_video { + fields: [] + sql_on: ${sessions.session_attribution_source}=${paid_video.channel} and + REGEXP_CONTAINS(${sessions.session_attribution_medium}, r"^(.*cp.*|ppc|paid.*)$") = true;; + relationship: many_to_one + } + join: paid_search { + fields: [] + sql_on: ${sessions.session_attribution_source}=${paid_search.channel} + and REGEXP_CONTAINS(${sessions.session_attribution_medium}, r"^(.*cp.*|ppc|paid.*)$") = true;; + relationship: many_to_one + } + join: organic_shopping { + fields: [] + sql_on: ${sessions.session_attribution_source}=${organic_shopping.channel} + or REGEXP_CONTAINS(${sessions.session_attribution_campaign}, r"^(.*(([^a-df-z]|^)shop|shopping).*)$") = true;; + relationship: many_to_one + } + join: organic_social { + fields: [] + sql_on: ${sessions.session_attribution_source}=${organic_social.channel} + or REGEXP_CONTAINS(${sessions.session_attribution_medium}, r"(social|social-network|social-media|sm|social network|social media)") = true;; + relationship: many_to_one + } + join: organic_video { + fields: [] + sql_on: ${sessions.session_attribution_source}=${organic_video.channel} + or REGEXP_CONTAINS(${sessions.session_attribution_medium}, r"^(.*video.*)$") = true;; + relationship: many_to_one + } + join: organic_search { + fields: [] + sql_on: ${sessions.session_attribution_source}=${organic_video.channel} + or ${sessions.session_attribution_medium} = 'organic';; + relationship: many_to_one + } + join: others { + fields: [] + sql_on: ${sessions.session_attribution_medium} = ${others.medium};; + relationship: many_to_one + } + join: attribution_sources { + sql: ;; + relationship: one_to_one + view_label: "Acquisition" + } + join: forecasting { + type: full_outer + sql_on:${forecasting.forecast_timestamp}=${events.event_time_date} ;;#${events.event_name}=${forecasting.events_event_name} AND + relationship: one_to_one + view_label: "ARIMA" + } + #join: arima_join { + # type: inner + # sql_on: ${forecasting.forecast_timestamp}=${arima_join.date_join} OR + # ${sessions.session_date}=${arima_join.date_join};; + # relationship: many_to_one + # view_label: "ARIMA" + #} + +} diff --git a/manifest.lkml b/manifest.lkml new file mode 100644 index 0000000..72593b8 --- /dev/null +++ b/manifest.lkml @@ -0,0 +1,40 @@ +project_name: "ga_four" + +## Connection Constants: +constant: GA4_CONNECTION { + value: "" + export: override_required +} + +constant: GA4_SCHEMA { + value: "ga4_export" + export: override_optional +} + +constant: GA4_TABLE_VARIABLE { + value: "events_*" + export: override_optional +} +constant: EVENT_COUNT { + value: "" + export: override_optional +} +constant: model_step_prediction { + value: "60" + #export: override_optional +} + +constant: GA4_BQML_train_months { + value: "12" + # export: override_optional +} + +constant: GA4_BQML_test_months { + value: "3" + # export: override_optional +} + +constant: GA4_BQML_future_synth_months { + value: "12" + # export: override_optional +} diff --git a/marketplace.json b/marketplace.json new file mode 100644 index 0000000..f138f36 --- /dev/null +++ b/marketplace.json @@ -0,0 +1,29 @@ +{ + "label": "Google Analytics 4 - Web Analytics", + "category_label": "Models", + "branding": { + "image_uri": "https://marketplace-api.looker.com/block-icons/icon-google-analytics-new.png", + "tagline": "Analyze and activate web-traffic data in BigQuery from GA4." + }, + "constants": { + "GA4_CONNECTION": { + "label": "Connection Name", + "value_constraint": "connection" + }, + "GA4_SCHEMA": { + "label": "GA4 Schema" + }, + "GA4_TABLE_VARIABLE": { + "label": "GA4 Table Variable" + }, + "EVENT_COUNT": { + "label": "Event Count Limit" + } + }, + "models": [ + { + "name": "ga4", + "connection_constant": "GA4_CONNECTION" + } + ] +} diff --git a/models/ga4.model.lkml b/models/ga4.model.lkml new file mode 100644 index 0000000..bde80f9 --- /dev/null +++ b/models/ga4.model.lkml @@ -0,0 +1,24 @@ +connection: "@{GA4_CONNECTION}" + +include: "/dashboards/*.dashboard" +include: "/explores/*.explore.lkml" +include: "/views/**/*.view.lkml" + +label: "Google Analytics 4" + + +datagroup: ga4_main_datagroup { + sql_trigger: SELECT CURRENT_DATE();; + max_cache_age: "3 hour" +} + +datagroup: ga4_default_datagroup { + sql_trigger: SELECT FLOOR(((TIMESTAMP_DIFF(CURRENT_TIMESTAMP(),'1970-01-01 00:00:00',SECOND)) - 60*60*1)/(60*60*24));; + max_cache_age: "3 hour" +} + +datagroup: ga4_attribution_channel { + sql_trigger: SELECT 1 ;; +} + +persist_with: ga4_main_datagroup diff --git a/views/.gitkeep b/views/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/views/attribution_sources.view.lkml b/views/attribution_sources.view.lkml new file mode 100644 index 0000000..2766a4e --- /dev/null +++ b/views/attribution_sources.view.lkml @@ -0,0 +1,12 @@ +include: "/views/attribution_sources/*.view.lkml" +view: attribution_sources { +dimension: attribution_source_channel { + group_label: "Session Traffic Source" + label: "Channel" + type: string + sql: COALESCE(${paid_shopping.source}, + ${paid_social.source},${paid_search.source}, + ${paid_video.source},${organic_shopping.source},${organic_social.source}, + ${organic_video.source},${organic_search.source},${others.source},"Other");; +} +} diff --git a/views/attribution_sources/organic_search.view.lkml b/views/attribution_sources/organic_search.view.lkml new file mode 100644 index 0000000..1093e9d --- /dev/null +++ b/views/attribution_sources/organic_search.view.lkml @@ -0,0 +1,150 @@ +view: organic_search { + derived_table: { + datagroup_trigger:attribution_channel + sql: select '360.cn' as channel, 'Organic Search'as source UNION ALL + select 'babylon' as channel, 'Organic Search'as source UNION ALL + select 'centrum.cz' as channel, 'Organic Search'as source UNION ALL + select 'conduit' as channel, 'Organic Search'as source UNION ALL + select 'duckduckgo' as channel, 'Organic Search'as source UNION ALL + select 'excite.com' as channel, 'Organic Search'as source UNION ALL + select 'google.com' as channel, 'Organic Search'as source UNION ALL + select 'it.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'mail.google.com' as channel, 'Organic Search'as source UNION ALL + select 'najdi' as channel, 'Organic Search'as source UNION ALL + select 'onet' as channel, 'Organic Search'as source UNION ALL + select 'rambler' as channel, 'Organic Search'as source UNION ALL + select 'search.smt.docomo.ne.jp' as channel, 'Organic Search'as source UNION ALL + select 'sogou.com' as channel, 'Organic Search'as source UNION ALL + select 'tr.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'vn.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'yandex' as channel, 'Organic Search'as source UNION ALL + select 'alice' as channel, 'Organic Search'as source UNION ALL + select 'baidu' as channel, 'Organic Search'as source UNION ALL + select 'ch.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'cse.google.com' as channel, 'Organic Search'as source UNION ALL + select 'ecosia.org' as channel, 'Organic Search'as source UNION ALL + select 'fi.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'googlemybusiness' as channel, 'Organic Search'as source UNION ALL + select 'kvasir' as channel, 'Organic Search'as source UNION ALL + select 'mail.rambler.ru' as channel, 'Organic Search'as source UNION ALL + select 'naver' as channel, 'Organic Search'as source UNION ALL + select 'onet.pl' as channel, 'Organic Search'as source UNION ALL + select 'rambler.ru' as channel, 'Organic Search'as source UNION ALL + select 'search.ukr.net' as channel, 'Organic Search'as source UNION ALL + select 'sp-web.search.auone.jp' as channel, 'Organic Search'as source UNION ALL + select 'tut.by' as channel, 'Organic Search'as source UNION ALL + select 'wap.sogou.com' as channel, 'Organic Search'as source UNION ALL + select 'yandex.by' as channel, 'Organic Search'as source UNION ALL + select 'aol' as channel, 'Organic Search'as source UNION ALL + select 'biglobe' as channel, 'Organic Search'as source UNION ALL + select 'cl.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'daum' as channel, 'Organic Search'as source UNION ALL + select 'email.seznam.cz' as channel, 'Organic Search'as source UNION ALL + select 'firmy.cz' as channel, 'Organic Search'as source UNION ALL + select 'hk.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'lite.qwant.com' as channel, 'Organic Search'as source UNION ALL + select 'mail.yandex.ru' as channel, 'Organic Search'as source UNION ALL + select 'naver.com' as channel, 'Organic Search'as source UNION ALL + select 'pe.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'se.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'secureurl.ukr.net' as channel, 'Organic Search'as source UNION ALL + select 'startsiden' as channel, 'Organic Search'as source UNION ALL + select 'tw.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'webmaster.yandex.ru' as channel, 'Organic Search'as source UNION ALL + select 'yandex.com' as channel, 'Organic Search'as source UNION ALL + select 'ar.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'biglobe.co.jp' as channel, 'Organic Search'as source UNION ALL + select 'cn.bing.com' as channel, 'Organic Search'as source UNION ALL + select 'daum.net' as channel, 'Organic Search'as source UNION ALL + select 'eniro' as channel, 'Organic Search'as source UNION ALL + select 'fr.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'id.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'lycos' as channel, 'Organic Search'as source UNION ALL + select 'malaysia.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'news.google.com' as channel, 'Organic Search'as source UNION ALL + select 'ph.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'search-results' as channel, 'Organic Search'as source UNION ALL + select 'seznam' as channel, 'Organic Search'as source UNION ALL + select 'startsiden.no' as channel, 'Organic Search'as source UNION ALL + select 'uk.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'websearch.rakuten.co.jp' as channel, 'Organic Search'as source UNION ALL + select 'yandex.com.tr' as channel, 'Organic Search'as source UNION ALL + select 'ask' as channel, 'Organic Search'as source UNION ALL + select 'biglobe.ne.jp' as channel, 'Organic Search'as source UNION ALL + select 'cnn' as channel, 'Organic Search'as source UNION ALL + select 'de.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'es.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'globo' as channel, 'Organic Search'as source UNION ALL + select 'in.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'm.baidu.com' as channel, 'Organic Search'as source UNION ALL + select 'msn' as channel, 'Organic Search'as source UNION ALL + select 'nl.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'pl.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'search.aol.co.uk' as channel, 'Organic Search'as source UNION ALL + select 'seznam.cz' as channel, 'Organic Search'as source UNION ALL + select 'suche.aol.de' as channel, 'Organic Search'as source UNION ALL + select 'ukr' as channel, 'Organic Search'as source UNION ALL + select 'yahoo' as channel, 'Organic Search'as source UNION ALL + select 'yandex.fr' as channel, 'Organic Search'as source UNION ALL + select 'at.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'bing' as channel, 'Organic Search'as source UNION ALL + select 'co.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'dk.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'espanol.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'go.mail.ru' as channel, 'Organic Search'as source UNION ALL + select 'incredimail' as channel, 'Organic Search'as source UNION ALL + select 'm.naver.com' as channel, 'Organic Search'as source UNION ALL + select 'msn.com' as channel, 'Organic Search'as source UNION ALL + select 'no.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'qwant' as channel, 'Organic Search'as source UNION ALL + select 'search.aol.com' as channel, 'Organic Search'as source UNION ALL + select 'sg.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'terra' as channel, 'Organic Search'as source UNION ALL + select 'us.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'yahoo.co.jp' as channel, 'Organic Search'as source UNION ALL + select 'yandex.kz' as channel, 'Organic Search'as source UNION ALL + select 'au.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'br.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'comcast' as channel, 'Organic Search'as source UNION ALL + select 'dogpile' as channel, 'Organic Search'as source UNION ALL + select 'exalead.com' as channel, 'Organic Search'as source UNION ALL + select 'google' as channel, 'Organic Search'as source UNION ALL + select 'm.search.naver.com' as channel, 'Organic Search'as source UNION ALL + select 'mx.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'ntp.msn.com' as channel, 'Organic Search'as source UNION ALL + select 'qwant.com' as channel, 'Organic Search'as source UNION ALL + select 'search.google.com' as channel, 'Organic Search'as source UNION ALL + select 'so.com' as channel, 'Organic Search'as source UNION ALL + select 'th.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'virgilio' as channel, 'Organic Search'as source UNION ALL + select 'yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'yandex.ru' as channel, 'Organic Search'as source UNION ALL + select 'auone' as channel, 'Organic Search'as source UNION ALL + select 'ca.search.yahoo.com' as channel, 'Organic Search'as source UNION ALL + select 'dogpile.com' as channel, 'Organic Search'as source UNION ALL + select 'google-play' as channel, 'Organic Search'as source UNION ALL + select 'm.sogou.com' as channel, 'Organic Search'as source ;; + } + + measure: count { + type: count + drill_fields: [detail*] + } + + dimension: channel { + type: string + sql: ${TABLE}.channel ;; + } + + dimension: source { + type: string + sql: ${TABLE}.source ;; + } + + set: detail { + fields: [ + channel, + source + ] + } +} diff --git a/views/attribution_sources/organic_shopping.view.lkml b/views/attribution_sources/organic_shopping.view.lkml new file mode 100644 index 0000000..3f34109 --- /dev/null +++ b/views/attribution_sources/organic_shopping.view.lkml @@ -0,0 +1,77 @@ +view: organic_shopping { + derived_table: { + datagroup_trigger:attribution_channel + sql: select 'Google Shopping' as channel, 'Organic Shopping'as source UNION ALL + select 'alibaba.com' as channel, 'Organic Shopping'as source UNION ALL + select 'cr.shopping.naver.com' as channel, 'Organic Shopping'as source UNION ALL + select 'etsy' as channel, 'Organic Shopping'as source UNION ALL + select 'mercadolibre.com.mx' as channel, 'Organic Shopping'as source UNION ALL + select 'one.walmart.com' as channel, 'Organic Shopping'as source UNION ALL + select 'shopify.com' as channel, 'Organic Shopping'as source UNION ALL + select 'store.shopping.yahoo.co.jp' as channel, 'Organic Shopping'as source UNION ALL + select 'IGShopping' as channel, 'Organic Shopping'as source UNION ALL + select 'amazon' as channel, 'Organic Shopping'as source UNION ALL + select 'cr2.shopping.naver.com' as channel, 'Organic Shopping'as source UNION ALL + select 'etsy.com' as channel, 'Organic Shopping'as source UNION ALL + select 'message.alibaba.com' as channel, 'Organic Shopping'as source UNION ALL + select 'order.shopping.yahoo.co.jp' as channel, 'Organic Shopping'as source UNION ALL + select 'shopping.naver.com' as channel, 'Organic Shopping'as source UNION ALL + select 'stripe' as channel, 'Organic Shopping'as source UNION ALL + select 'aax-us-east.amazon-adsystem.com' as channel, 'Organic Shopping'as source UNION ALL + select 'amazon.co.uk' as channel, 'Organic Shopping'as source UNION ALL + select 'ebay' as channel, 'Organic Shopping'as source UNION ALL + select 'm.alibaba.com' as channel, 'Organic Shopping'as source UNION ALL + select 'msearch.shopping.naver.com' as channel, 'Organic Shopping'as source UNION ALL + select 'partners.shopify.com' as channel, 'Organic Shopping'as source UNION ALL + select 'shopping.yahoo.co.jp' as channel, 'Organic Shopping'as source UNION ALL + select 'stripe.com' as channel, 'Organic Shopping'as source UNION ALL + select 'aax.amazon-adsystem.com' as channel, 'Organic Shopping'as source UNION ALL + select 'amazon.com' as channel, 'Organic Shopping'as source UNION ALL + select 'ebay.co.uk' as channel, 'Organic Shopping'as source UNION ALL + select 'm.shopping.naver.com' as channel, 'Organic Shopping'as source UNION ALL + select 'nl.shopping.net' as channel, 'Organic Shopping'as source UNION ALL + select 's3.amazonaws.com' as channel, 'Organic Shopping'as source UNION ALL + select 'shopping.yahoo.com' as channel, 'Organic Shopping'as source UNION ALL + select 'uk.shopping.net' as channel, 'Organic Shopping'as source UNION ALL + select 'alibaba' as channel, 'Organic Shopping'as source UNION ALL + select 'apps.shopify.com' as channel, 'Organic Shopping'as source UNION ALL + select 'ebay.com' as channel, 'Organic Shopping'as source UNION ALL + select 'mercadolibre' as channel, 'Organic Shopping'as source UNION ALL + select 'no.shopping.net' as channel, 'Organic Shopping'as source UNION ALL + select 'se.shopping.net' as channel, 'Organic Shopping'as source UNION ALL + select 'shopzilla' as channel, 'Organic Shopping'as source UNION ALL + select 'walmart' as channel, 'Organic Shopping'as source UNION ALL + select 'checkout.shopify.com' as channel, 'Organic Shopping'as source UNION ALL + select 'ebay.com.au' as channel, 'Organic Shopping'as source UNION ALL + select 'mercadolibre.com' as channel, 'Organic Shopping'as source UNION ALL + select 'offer.alibaba.com' as channel, 'Organic Shopping'as source UNION ALL + select 'shop.app' as channel, 'Organic Shopping'as source UNION ALL + select 'shopzilla.com' as channel, 'Organic Shopping'as source UNION ALL + select 'walmart.com' as channel, 'Organic Shopping'as source UNION ALL + select 'checkout.stripe.com' as channel, 'Organic Shopping'as source UNION ALL + select 'ebay.de' as channel, 'Organic Shopping'as source UNION ALL + select 'mercadolibre.com.ar' as channel, 'Organic Shopping'as source ;; + } + + measure: count { + type: count + drill_fields: [detail*] + } + + dimension: channel { + type: string + sql: ${TABLE}.channel ;; + } + + dimension: source { + type: string + sql: ${TABLE}.source ;; + } + + set: detail { + fields: [ + channel, + source + ] + } +} diff --git a/views/attribution_sources/organic_social.view.lkml b/views/attribution_sources/organic_social.view.lkml new file mode 100644 index 0000000..15de03b --- /dev/null +++ b/views/attribution_sources/organic_social.view.lkml @@ -0,0 +1,498 @@ +view: organic_social { + derived_table: { + datagroup_trigger:attribution_channel + sql: select '43things' as channel, 'Organic Social' as source UNION ALL + select 'ameblo.jp' as channel, 'Organic Social' as source UNION ALL + select 'askubuntu.com' as channel, 'Organic Social' as source UNION ALL + select 'biip.no' as channel, 'Organic Social' as source UNION ALL + select 'bloglines' as channel, 'Organic Social' as source UNION ALL + select 'business.facebook.com' as channel, 'Organic Social' as source UNION ALL + select 'cellufun.com' as channel, 'Organic Social' as source UNION ALL + select 'couchsurfing.org' as channel, 'Organic Social' as source UNION ALL + select 'diigo.com' as channel, 'Organic Social' as source UNION ALL + select 'edublogs.org' as channel, 'Organic Social' as source UNION ALL + select 'feministing.com' as channel, 'Organic Social' as source UNION ALL + select 'forums.webosnation.com' as channel, 'Organic Social' as source UNION ALL + select 'gamerdna' as channel, 'Organic Social' as source UNION ALL + select 'googlegroups.com' as channel, 'Organic Social' as source UNION ALL + select 'hr.com' as channel, 'Organic Social' as source UNION ALL + select 'instagram.com' as channel, 'Organic Social' as source UNION ALL + select 'kaneva' as channel, 'Organic Social' as source UNION ALL + select 'livedoorblog' as channel, 'Organic Social' as source UNION ALL + select 'messages.google.com' as channel, 'Organic Social' as source UNION ALL + select 'mylife' as channel, 'Organic Social' as source UNION ALL + select 'odnoklassniki.ua' as channel, 'Organic Social' as source UNION ALL + select 'pingsta.com' as channel, 'Organic Social' as source UNION ALL + select 'pinterest.pt' as channel, 'Organic Social' as source UNION ALL + select 'quechup.com' as channel, 'Organic Social' as source UNION ALL + select 'scoop.it' as channel, 'Organic Social' as source UNION ALL + select 'slideshare.net' as channel, 'Organic Social' as source UNION ALL + select 'stardoll.com' as channel, 'Organic Social' as source UNION ALL + select 'tiktok.com' as channel, 'Organic Social' as source UNION ALL + select 'twitter' as channel, 'Organic Social' as source UNION ALL + select 'web.skype.com' as channel, 'Organic Social' as source UNION ALL + select 'xanga.com' as channel, 'Organic Social' as source UNION ALL + select '43things.com' as channel, 'Organic Social' as source UNION ALL + select 'americantowns' as channel, 'Organic Social' as source UNION ALL + select 'asmallworld.com' as channel, 'Organic Social' as source UNION ALL + select 'biswap.org' as channel, 'Organic Social' as source UNION ALL + select 'bloglines.com' as channel, 'Organic Social' as source UNION ALL + select 'buzzfeed' as channel, 'Organic Social' as source UNION ALL + select 'centerblog.net' as channel, 'Organic Social' as source UNION ALL + select 'cozycot' as channel, 'Organic Social' as source UNION ALL + select 'discover.hubpages.com' as channel, 'Organic Social' as source UNION ALL + select 'elftown' as channel, 'Organic Social' as source UNION ALL + select 'filmaffinity' as channel, 'Organic Social' as source UNION ALL + select 'forums.wpcentral.com' as channel, 'Organic Social' as source UNION ALL + select 'gamerdna.com' as channel, 'Organic Social' as source UNION ALL + select 'googleplus' as channel, 'Organic Social' as source UNION ALL + select 'hu.pinterest.com' as channel, 'Organic Social' as source UNION ALL + select 'instapaper' as channel, 'Organic Social' as source UNION ALL + select 'kaneva.com' as channel, 'Organic Social' as source UNION ALL + select 'livejournal' as channel, 'Organic Social' as source UNION ALL + select 'messages.yahoo.co.jp' as channel, 'Organic Social' as source UNION ALL + select 'mylife.com' as channel, 'Organic Social' as source UNION ALL + select 'okwave.jp' as channel, 'Organic Social' as source UNION ALL + select 'pinterest' as channel, 'Organic Social' as source UNION ALL + select 'pinterest.ru' as channel, 'Organic Social' as source UNION ALL + select 'quora' as channel, 'Organic Social' as source UNION ALL + select 'screenrant' as channel, 'Organic Social' as source UNION ALL + select 'smartnews.com' as channel, 'Organic Social' as source UNION ALL + select 'stickam' as channel, 'Organic Social' as source UNION ALL + select 'tinyurl' as channel, 'Organic Social' as source UNION ALL + select 'twitter.com' as channel, 'Organic Social' as source UNION ALL + select 'webshots' as channel, 'Organic Social' as source UNION ALL + select 'xing' as channel, 'Organic Social' as source UNION ALL + select '51.com' as channel, 'Organic Social' as source UNION ALL + select 'americantowns.com' as channel, 'Organic Social' as source UNION ALL + select 'athlinks' as channel, 'Organic Social' as source UNION ALL + select 'bit.ly' as channel, 'Organic Social' as source UNION ALL + select 'blogs.com' as channel, 'Organic Social' as source UNION ALL + select 'buzzfeed.com' as channel, 'Organic Social' as source UNION ALL + select 'chat.zalo.me' as channel, 'Organic Social' as source UNION ALL + select 'cozycot.com' as channel, 'Organic Social' as source UNION ALL + select 'disqus' as channel, 'Organic Social' as source UNION ALL + select 'elftown.com' as channel, 'Organic Social' as source UNION ALL + select 'filmaffinity.com' as channel, 'Organic Social' as source UNION ALL + select 'fotki' as channel, 'Organic Social' as source UNION ALL + select 'gather.com' as channel, 'Organic Social' as source UNION ALL + select 'govloop' as channel, 'Organic Social' as source UNION ALL + select 'hubculture' as channel, 'Organic Social' as source UNION ALL + select 'instapaper.com' as channel, 'Organic Social' as source UNION ALL + select 'kin.naver.com' as channel, 'Organic Social' as source UNION ALL + select 'livejournal.com' as channel, 'Organic Social' as source UNION ALL + select 'messenger' as channel, 'Organic Social' as source UNION ALL + select 'mymodernmet' as channel, 'Organic Social' as source UNION ALL + select 'old.reddit.com' as channel, 'Organic Social' as source UNION ALL + select 'pinterest.at' as channel, 'Organic Social' as source UNION ALL + select 'pinterest.se' as channel, 'Organic Social' as source UNION ALL + select 'quora.com' as channel, 'Organic Social' as source UNION ALL + select 'screenrant.com' as channel, 'Organic Social' as source UNION ALL + select 'snapchat' as channel, 'Organic Social' as source UNION ALL + select 'stickam.com' as channel, 'Organic Social' as source UNION ALL + select 'tinyurl.com' as channel, 'Organic Social' as source UNION ALL + select 'twoo.com' as channel, 'Organic Social' as source UNION ALL + select 'webshots.com' as channel, 'Organic Social' as source UNION ALL + select 'xing.com' as channel, 'Organic Social' as source UNION ALL + select '5ch.net' as channel, 'Organic Social' as source UNION ALL + select 'amp.reddit.com' as channel, 'Organic Social' as source UNION ALL + select 'athlinks.com' as channel, 'Organic Social' as source UNION ALL + select 'blackcareernetwork.com' as channel, 'Organic Social' as source UNION ALL + select 'blogsome' as channel, 'Organic Social' as source UNION ALL + select 'buzznet' as channel, 'Organic Social' as source UNION ALL + select 'chegg.com' as channel, 'Organic Social' as source UNION ALL + select 'cross.tv' as channel, 'Organic Social' as source UNION ALL + select 'disqus.com' as channel, 'Organic Social' as source UNION ALL + select 'epicurious.com' as channel, 'Organic Social' as source UNION ALL + select 'flickr' as channel, 'Organic Social' as source UNION ALL + select 'fotki.com' as channel, 'Organic Social' as source UNION ALL + select 'geni.com' as channel, 'Organic Social' as source UNION ALL + select 'govloop.com' as channel, 'Organic Social' as source UNION ALL + select 'hubculture.com' as channel, 'Organic Social' as source UNION ALL + select 'internations.org' as channel, 'Organic Social' as source UNION ALL + select 'l.facebook.com' as channel, 'Organic Social' as source UNION ALL + select 'lm.facebook.com' as channel, 'Organic Social' as source UNION ALL + select 'messenger.com' as channel, 'Organic Social' as source UNION ALL + select 'mymodernmet.com' as channel, 'Organic Social' as source UNION ALL + select 'oneworldgroup.org' as channel, 'Organic Social' as source UNION ALL + select 'pinterest.ca' as channel, 'Organic Social' as source UNION ALL + select 'pixiv.net' as channel, 'Organic Social' as source UNION ALL + select 'qzone.qq.com' as channel, 'Organic Social' as source UNION ALL + select 'scribd' as channel, 'Organic Social' as source UNION ALL + select 'snapchat.com' as channel, 'Organic Social' as source UNION ALL + select 'studivz.net' as channel, 'Organic Social' as source UNION ALL + select 'toolbox' as channel, 'Organic Social' as source UNION ALL + select 'typepad' as channel, 'Organic Social' as source UNION ALL + select 'wechat' as channel, 'Organic Social' as source UNION ALL + select 'yahoo-mbga.jp' as channel, 'Organic Social' as source UNION ALL + select 'Hatena' as channel, 'Organic Social' as source UNION ALL + select 'ancestry.com' as channel, 'Organic Social' as source UNION ALL + select 'away.vk.com' as channel, 'Organic Social' as source UNION ALL + select 'blackplanet' as channel, 'Organic Social' as source UNION ALL + select 'blogsome.com' as channel, 'Organic Social' as source UNION ALL + select 'buzznet.com' as channel, 'Organic Social' as source UNION ALL + select 'chicagonow' as channel, 'Organic Social' as source UNION ALL + select 'crunchyroll' as channel, 'Organic Social' as source UNION ALL + select 'dogster' as channel, 'Organic Social' as source UNION ALL + select 'everforo.com' as channel, 'Organic Social' as source UNION ALL + select 'flickr.com' as channel, 'Organic Social' as source UNION ALL + select 'fotolog' as channel, 'Organic Social' as source UNION ALL + select 'getpocket.com' as channel, 'Organic Social' as source UNION ALL + select 'gowalla' as channel, 'Organic Social' as source UNION ALL + select 'hubpages.com' as channel, 'Organic Social' as source UNION ALL + select 'interpals.net' as channel, 'Organic Social' as source UNION ALL + select 'l.instagram.com' as channel, 'Organic Social' as source UNION ALL + select 'lnkd.in' as channel, 'Organic Social' as source UNION ALL + select 'mix.com' as channel, 'Organic Social' as source UNION ALL + select 'myspace' as channel, 'Organic Social' as source UNION ALL + select 'onstartups' as channel, 'Organic Social' as source UNION ALL + select 'pinterest.ch' as channel, 'Organic Social' as source UNION ALL + select 'pl.pinterest.com' as channel, 'Organic Social' as source UNION ALL + select 'ravelry' as channel, 'Organic Social' as source UNION ALL + select 'scribd.com' as channel, 'Organic Social' as source UNION ALL + select 'sociallife.com.br' as channel, 'Organic Social' as source UNION ALL + select 'suomi24.fi' as channel, 'Organic Social' as source UNION ALL + select 'toolbox.com' as channel, 'Organic Social' as source UNION ALL + select 'typepad.com' as channel, 'Organic Social' as source UNION ALL + select 'wechat.com' as channel, 'Organic Social' as source UNION ALL + select 'yammer' as channel, 'Organic Social' as source UNION ALL + select 'ImageShack' as channel, 'Organic Social' as source UNION ALL + select 'anobii' as channel, 'Organic Social' as source UNION ALL + select 'awe.sm' as channel, 'Organic Social' as source UNION ALL + select 'blackplanet.com' as channel, 'Organic Social' as source UNION ALL + select 'blogspot' as channel, 'Organic Social' as source UNION ALL + select 'cafe.naver.com' as channel, 'Organic Social' as source UNION ALL + select 'chicagonow.com' as channel, 'Organic Social' as source UNION ALL + select 'crunchyroll.com' as channel, 'Organic Social' as source UNION ALL + select 'dogster.com' as channel, 'Organic Social' as source UNION ALL + select 'exblog.jp' as channel, 'Organic Social' as source UNION ALL + select 'flipboard' as channel, 'Organic Social' as source UNION ALL + select 'fotolog.com' as channel, 'Organic Social' as source UNION ALL + select 'glassboard' as channel, 'Organic Social' as source UNION ALL + select 'gowalla.com' as channel, 'Organic Social' as source UNION ALL + select 'hyves.net' as channel, 'Organic Social' as source UNION ALL + select 'intherooms' as channel, 'Organic Social' as source UNION ALL + select 'l.messenger.com' as channel, 'Organic Social' as source UNION ALL + select 'm.blog.naver.com' as channel, 'Organic Social' as source UNION ALL + select 'mixi.jp' as channel, 'Organic Social' as source UNION ALL + select 'myspace.com' as channel, 'Organic Social' as source UNION ALL + select 'onstartups.com' as channel, 'Organic Social' as source UNION ALL + select 'pinterest.cl' as channel, 'Organic Social' as source UNION ALL + select 'playahead.se' as channel, 'Organic Social' as source UNION ALL + select 'ravelry.com' as channel, 'Organic Social' as source UNION ALL + select 'scvngr' as channel, 'Organic Social' as source UNION ALL + select 'socialvibe' as channel, 'Organic Social' as source UNION ALL + select 'superuser' as channel, 'Organic Social' as source UNION ALL + select 'touch.facebook.com' as channel, 'Organic Social' as source UNION ALL + select 'unblog.fr' as channel, 'Organic Social' as source UNION ALL + select 'weebly' as channel, 'Organic Social' as source UNION ALL + select 'yammer.com' as channel, 'Organic Social' as source UNION ALL + select 'academia.edu' as channel, 'Organic Social' as source UNION ALL + select 'anobii.com' as channel, 'Organic Social' as source UNION ALL + select 'b.hatena.ne.jp' as channel, 'Organic Social' as source UNION ALL + select 'blip.fm' as channel, 'Organic Social' as source UNION ALL + select 'blogspot.com' as channel, 'Organic Social' as source UNION ALL + select 'cafemom' as channel, 'Organic Social' as source UNION ALL + select 'chiebukuro.yahoo.co.jp' as channel, 'Organic Social' as source UNION ALL + select 'cyworld' as channel, 'Organic Social' as source UNION ALL + select 'dol2day' as channel, 'Organic Social' as source UNION ALL + select 'extole' as channel, 'Organic Social' as source UNION ALL + select 'flipboard.com' as channel, 'Organic Social' as source UNION ALL + select 'foursquare' as channel, 'Organic Social' as source UNION ALL + select 'glassboard.com' as channel, 'Organic Social' as source UNION ALL + select 'gree.jp' as channel, 'Organic Social' as source UNION ALL + select 'hyves.nl' as channel, 'Organic Social' as source UNION ALL + select 'intherooms.com' as channel, 'Organic Social' as source UNION ALL + select 'last.fm' as channel, 'Organic Social' as source UNION ALL + select 'm.cafe.naver.com' as channel, 'Organic Social' as source UNION ALL + select 'mobile.facebook.com' as channel, 'Organic Social' as source UNION ALL + select 'netvibes' as channel, 'Organic Social' as source UNION ALL + select 'opendiary' as channel, 'Organic Social' as source UNION ALL + select 'pinterest.co.kr' as channel, 'Organic Social' as source UNION ALL + select 'plurk' as channel, 'Organic Social' as source UNION ALL + select 'reddit' as channel, 'Organic Social' as source UNION ALL + select 'scvngr.com' as channel, 'Organic Social' as source UNION ALL + select 'socialvibe.com' as channel, 'Organic Social' as source UNION ALL + select 'superuser.com' as channel, 'Organic Social' as source UNION ALL + select 'tr.pinterest.com' as channel, 'Organic Social' as source UNION ALL + select 'urbanspoon.com' as channel, 'Organic Social' as source UNION ALL + select 'weebly.com' as channel, 'Organic Social' as source UNION ALL + select 'yelp' as channel, 'Organic Social' as source UNION ALL + select 'activerain' as channel, 'Organic Social' as source UNION ALL + select 'answerbag' as channel, 'Organic Social' as source UNION ALL + select 'baby-gaga' as channel, 'Organic Social' as source UNION ALL + select 'blog.com' as channel, 'Organic Social' as source UNION ALL + select 'blogster' as channel, 'Organic Social' as source UNION ALL + select 'cafemom.com' as channel, 'Organic Social' as source UNION ALL + select 'classmates' as channel, 'Organic Social' as source UNION ALL + select 'cyworld.com' as channel, 'Organic Social' as source UNION ALL + select 'dol2day.com' as channel, 'Organic Social' as source UNION ALL + select 'extole.com' as channel, 'Organic Social' as source UNION ALL + select 'folkdirect' as channel, 'Organic Social' as source UNION ALL + select 'foursquare.com' as channel, 'Organic Social' as source UNION ALL + select 'glassdoor' as channel, 'Organic Social' as source UNION ALL + select 'groups.google.com' as channel, 'Organic Social' as source UNION ALL + select 'ibibo' as channel, 'Organic Social' as source UNION ALL + select 'irc-galleria.net' as channel, 'Organic Social' as source UNION ALL + select 'librarything' as channel, 'Organic Social' as source UNION ALL + select 'm.facebook.com' as channel, 'Organic Social' as source UNION ALL + select 'mocospace' as channel, 'Organic Social' as source UNION ALL + select 'netvibes.com' as channel, 'Organic Social' as source UNION ALL + select 'opendiary.com' as channel, 'Organic Social' as source UNION ALL + select 'pinterest.co.uk' as channel, 'Organic Social' as source UNION ALL + select 'plurk.com' as channel, 'Organic Social' as source UNION ALL + select 'reddit.com' as channel, 'Organic Social' as source UNION ALL + select 'secondlife' as channel, 'Organic Social' as source UNION ALL + select 'spaces.live.com' as channel, 'Organic Social' as source UNION ALL + select 'sweeva' as channel, 'Organic Social' as source UNION ALL + select 'travellerspoint' as channel, 'Organic Social' as source UNION ALL + select 'ushareit.com' as channel, 'Organic Social' as source UNION ALL + select 'weibo' as channel, 'Organic Social' as source UNION ALL + select 'yelp.co.uk' as channel, 'Organic Social' as source UNION ALL + select 'activerain.com' as channel, 'Organic Social' as source UNION ALL + select 'answerbag.com' as channel, 'Organic Social' as source UNION ALL + select 'baby-gaga.com' as channel, 'Organic Social' as source UNION ALL + select 'blog.feedspot.com' as channel, 'Organic Social' as source UNION ALL + select 'blogster.com' as channel, 'Organic Social' as source UNION ALL + select 'camospace' as channel, 'Organic Social' as source UNION ALL + select 'classmates.com' as channel, 'Organic Social' as source UNION ALL + select 'cz.pinterest.com' as channel, 'Organic Social' as source UNION ALL + select 'doostang' as channel, 'Organic Social' as source UNION ALL + select 'facebook' as channel, 'Organic Social' as source UNION ALL + select 'folkdirect.com' as channel, 'Organic Social' as source UNION ALL + select 'free.facebook.com' as channel, 'Organic Social' as source UNION ALL + select 'glassdoor.com' as channel, 'Organic Social' as source UNION ALL + select 'gulli.com' as channel, 'Organic Social' as source UNION ALL + select 'ibibo.com' as channel, 'Organic Social' as source UNION ALL + select 'is.gd' as channel, 'Organic Social' as source UNION ALL + select 'librarything.com' as channel, 'Organic Social' as source UNION ALL + select 'm.kin.naver.com' as channel, 'Organic Social' as source UNION ALL + select 'mocospace.com' as channel, 'Organic Social' as source UNION ALL + select 'news.ycombinator.com' as channel, 'Organic Social' as source UNION ALL + select 'oshiete.goo.ne.jp' as channel, 'Organic Social' as source UNION ALL + select 'pinterest.com' as channel, 'Organic Social' as source UNION ALL + select 'plus.google.com' as channel, 'Organic Social' as source UNION ALL + select 'redux' as channel, 'Organic Social' as source UNION ALL + select 'secondlife.com' as channel, 'Organic Social' as source UNION ALL + select 'spoke' as channel, 'Organic Social' as source UNION ALL + select 'sweeva.com' as channel, 'Organic Social' as source UNION ALL + select 'travellerspoint.com' as channel, 'Organic Social' as source UNION ALL + select 'ushi.cn' as channel, 'Organic Social' as source UNION ALL + select 'weibo.com' as channel, 'Organic Social' as source UNION ALL + select 'yelp.com' as channel, 'Organic Social' as source UNION ALL + select 'activeworlds' as channel, 'Organic Social' as source UNION ALL + select 'answers.yahoo.com' as channel, 'Organic Social' as source UNION ALL + select 'babyblog.ru' as channel, 'Organic Social' as source UNION ALL + select 'blog.goo.ne.jp' as channel, 'Organic Social' as source UNION ALL + select 'blurtit' as channel, 'Organic Social' as source UNION ALL + select 'camospace.com' as channel, 'Organic Social' as source UNION ALL + select 'classquest' as channel, 'Organic Social' as source UNION ALL + select 'd.hatena.ne.jp' as channel, 'Organic Social' as source UNION ALL + select 'doostang.com' as channel, 'Organic Social' as source UNION ALL + select 'facebook.com' as channel, 'Organic Social' as source UNION ALL + select 'foodservice' as channel, 'Organic Social' as source UNION ALL + select 'friendfeed' as channel, 'Organic Social' as source UNION ALL + select 'godtube' as channel, 'Organic Social' as source UNION ALL + select 'gutefrage.net' as channel, 'Organic Social' as source UNION ALL + select 'id.pinterest.com' as channel, 'Organic Social' as source UNION ALL + select 'italki' as channel, 'Organic Social' as source UNION ALL + select 'lifestream.aol.com' as channel, 'Organic Social' as source UNION ALL + select 'm.vk.com' as channel, 'Organic Social' as source UNION ALL + select 'mouthshut' as channel, 'Organic Social' as source UNION ALL + select 'newsshowcase' as channel, 'Organic Social' as source UNION ALL + select 'out.reddit.com' as channel, 'Organic Social' as source UNION ALL + select 'pinterest.com.au' as channel, 'Organic Social' as source UNION ALL + select 'plus.url.google.com' as channel, 'Organic Social' as source UNION ALL + select 'redux.com' as channel, 'Organic Social' as source UNION ALL + select 'serverfault' as channel, 'Organic Social' as source UNION ALL + select 'spoke.com' as channel, 'Organic Social' as source UNION ALL + select 't.co' as channel, 'Organic Social' as source UNION ALL + select 'tripadvisor' as channel, 'Organic Social' as source UNION ALL + select 'vampirefreaks' as channel, 'Organic Social' as source UNION ALL + select 'wer-weiss-was.de' as channel, 'Organic Social' as source UNION ALL + select 'youroom.in' as channel, 'Organic Social' as source UNION ALL + select 'activeworlds.com' as channel, 'Organic Social' as source UNION ALL + select 'aolanswers' as channel, 'Organic Social' as source UNION ALL + select 'badoo' as channel, 'Organic Social' as source UNION ALL + select 'blog.naver.com' as channel, 'Organic Social' as source UNION ALL + select 'blurtit.com' as channel, 'Organic Social' as source UNION ALL + select 'canalblog.com' as channel, 'Organic Social' as source UNION ALL + select 'classquest.com' as channel, 'Organic Social' as source UNION ALL + select 'dailystrength.org' as channel, 'Organic Social' as source UNION ALL + select 'dopplr' as channel, 'Organic Social' as source UNION ALL + select 'faceparty' as channel, 'Organic Social' as source UNION ALL + select 'foodservice.com' as channel, 'Organic Social' as source UNION ALL + select 'friendfeed.com' as channel, 'Organic Social' as source UNION ALL + select 'godtube.com' as channel, 'Organic Social' as source UNION ALL + select 'habbo' as channel, 'Organic Social' as source UNION ALL + select 'identi.ca' as channel, 'Organic Social' as source UNION ALL + select 'italki.com' as channel, 'Organic Social' as source UNION ALL + select 'line' as channel, 'Organic Social' as source UNION ALL + select 'm.yelp.com' as channel, 'Organic Social' as source UNION ALL + select 'mouthshut.com' as channel, 'Organic Social' as source UNION ALL + select 'nexopia' as channel, 'Organic Social' as source UNION ALL + select 'over-blog.com' as channel, 'Organic Social' as source UNION ALL + select 'pinterest.com.mx' as channel, 'Organic Social' as source UNION ALL + select 'pocket.co' as channel, 'Organic Social' as source UNION ALL + select 'renren' as channel, 'Organic Social' as source UNION ALL + select 'serverfault.com' as channel, 'Organic Social' as source UNION ALL + select 'spruz' as channel, 'Organic Social' as source UNION ALL + select 't.me' as channel, 'Organic Social' as source UNION ALL + select 'tripadvisor.com' as channel, 'Organic Social' as source UNION ALL + select 'vampirefreaks.com' as channel, 'Organic Social' as source UNION ALL + select 'weread' as channel, 'Organic Social' as source UNION ALL + select 'za.pinterest.com' as channel, 'Organic Social' as source UNION ALL + select 'addthis' as channel, 'Organic Social' as source UNION ALL + select 'aolanswers.com' as channel, 'Organic Social' as source UNION ALL + select 'badoo.com' as channel, 'Organic Social' as source UNION ALL + select 'blog.yahoo.co.jp' as channel, 'Organic Social' as source UNION ALL + select 'bookmarks.yahoo.co.jp' as channel, 'Organic Social' as source UNION ALL + select 'care.com' as channel, 'Organic Social' as source UNION ALL + select 'co.pinterest.com' as channel, 'Organic Social' as source UNION ALL + select 'deluxe.com' as channel, 'Organic Social' as source UNION ALL + select 'dopplr.com' as channel, 'Organic Social' as source UNION ALL + select 'faceparty.com' as channel, 'Organic Social' as source UNION ALL + select 'forums.androidcentral.com' as channel, 'Organic Social' as source UNION ALL + select 'fruehstueckstreff.org' as channel, 'Organic Social' as source UNION ALL + select 'goldenline.pl' as channel, 'Organic Social' as source UNION ALL + select 'habbo.com' as channel, 'Organic Social' as source UNION ALL + select 'ig' as channel, 'Organic Social' as source UNION ALL + select 'jammerdirect' as channel, 'Organic Social' as source UNION ALL + select 'line.me' as channel, 'Organic Social' as source UNION ALL + select 'mbga.jp' as channel, 'Organic Social' as source UNION ALL + select 'movabletype' as channel, 'Organic Social' as source UNION ALL + select 'ngopost.org' as channel, 'Organic Social' as source UNION ALL + select 'overblog.com' as channel, 'Organic Social' as source UNION ALL + select 'pinterest.de' as channel, 'Organic Social' as source UNION ALL + select 'posterous' as channel, 'Organic Social' as source UNION ALL + select 'renren.com' as channel, 'Organic Social' as source UNION ALL + select 'shareit' as channel, 'Organic Social' as source UNION ALL + select 'spruz.com' as channel, 'Organic Social' as source UNION ALL + select 'tagged' as channel, 'Organic Social' as source UNION ALL + select 'trombi' as channel, 'Organic Social' as source UNION ALL + select 'vampirerave' as channel, 'Organic Social' as source UNION ALL + select 'weread.com' as channel, 'Organic Social' as source UNION ALL + select 'zalo' as channel, 'Organic Social' as source UNION ALL + select 'addthis.com' as channel, 'Organic Social' as source UNION ALL + select 'apps.facebook.com' as channel, 'Organic Social' as source UNION ALL + select 'bebo' as channel, 'Organic Social' as source UNION ALL + select 'blogg.no' as channel, 'Organic Social' as source UNION ALL + select 'bookmarks.yahoo.com' as channel, 'Organic Social' as source UNION ALL + select 'care2' as channel, 'Organic Social' as source UNION ALL + select 'cocolog-nifty' as channel, 'Organic Social' as source UNION ALL + select 'deviantart' as channel, 'Organic Social' as source UNION ALL + select 'douban' as channel, 'Organic Social' as source UNION ALL + select 'fandom.com' as channel, 'Organic Social' as source UNION ALL + select 'forums.crackberry.com' as channel, 'Organic Social' as source UNION ALL + select 'fubar' as channel, 'Organic Social' as source UNION ALL + select 'goldstar' as channel, 'Organic Social' as source UNION ALL + select 'hi5' as channel, 'Organic Social' as source UNION ALL + select 'imageshack.com' as channel, 'Organic Social' as source UNION ALL + select 'jammerdirect.com' as channel, 'Organic Social' as source UNION ALL + select 'linkedin' as channel, 'Organic Social' as source UNION ALL + select 'medium.com' as channel, 'Organic Social' as source UNION ALL + select 'movabletype.com' as channel, 'Organic Social' as source UNION ALL + select 'niconico' as channel, 'Organic Social' as source UNION ALL + select 'paper.li' as channel, 'Organic Social' as source UNION ALL + select 'pinterest.es' as channel, 'Organic Social' as source UNION ALL + select 'posterous.com' as channel, 'Organic Social' as source UNION ALL + select 'researchgate.net' as channel, 'Organic Social' as source UNION ALL + select 'sharethis' as channel, 'Organic Social' as source UNION ALL + select 'ssense.com' as channel, 'Organic Social' as source UNION ALL + select 'tagged.com' as channel, 'Organic Social' as source UNION ALL + select 'trombi.com' as channel, 'Organic Social' as source UNION ALL + select 'vampirerave.com' as channel, 'Organic Social' as source UNION ALL + select 'whatsapp' as channel, 'Organic Social' as source UNION ALL + select 'zoo.gr' as channel, 'Organic Social' as source UNION ALL + select 'airg.ca' as channel, 'Organic Social' as source UNION ALL + select 'ar.pinterest.com' as channel, 'Organic Social' as source UNION ALL + select 'bebo.com' as channel, 'Organic Social' as source UNION ALL + select 'bloggang.com' as channel, 'Organic Social' as source UNION ALL + select 'br.pinterest.com' as channel, 'Organic Social' as source UNION ALL + select 'care2.com' as channel, 'Organic Social' as source UNION ALL + select 'cocolog-nifty.com' as channel, 'Organic Social' as source UNION ALL + select 'deviantart.com' as channel, 'Organic Social' as source UNION ALL + select 'douban.com' as channel, 'Organic Social' as source UNION ALL + select 'fanpop' as channel, 'Organic Social' as source UNION ALL + select 'forums.imore.com' as channel, 'Organic Social' as source UNION ALL + select 'fubar.com' as channel, 'Organic Social' as source UNION ALL + select 'goldstar.com' as channel, 'Organic Social' as source UNION ALL + select 'hi5.com' as channel, 'Organic Social' as source UNION ALL + select 'imageshack.us' as channel, 'Organic Social' as source UNION ALL + select 'jappy.com' as channel, 'Organic Social' as source UNION ALL + select 'linkedin.com' as channel, 'Organic Social' as source UNION ALL + select 'meetin.org' as channel, 'Organic Social' as source UNION ALL + select 'mubi' as channel, 'Organic Social' as source UNION ALL + select 'nicovideo.jp' as channel, 'Organic Social' as source UNION ALL + select 'partyflock.nl' as channel, 'Organic Social' as source UNION ALL + select 'pinterest.fr' as channel, 'Organic Social' as source UNION ALL + select 'pro.homeadvisor.com' as channel, 'Organic Social' as source UNION ALL + select 'reunion' as channel, 'Organic Social' as source UNION ALL + select 'sharethis.com' as channel, 'Organic Social' as source UNION ALL + select 'stackapps' as channel, 'Organic Social' as source UNION ALL + select 'taggedmail' as channel, 'Organic Social' as source UNION ALL + select 'tudou' as channel, 'Organic Social' as source UNION ALL + select 'vg.no' as channel, 'Organic Social' as source UNION ALL + select 'whatsapp.com' as channel, 'Organic Social' as source UNION ALL + select 'zooppa' as channel, 'Organic Social' as source UNION ALL + select 'allnurses.com' as channel, 'Organic Social' as source UNION ALL + select 'artstation.com' as channel, 'Organic Social' as source UNION ALL + select 'beforeitsnews' as channel, 'Organic Social' as source UNION ALL + select 'blogger' as channel, 'Organic Social' as source UNION ALL + select 'brightkite' as channel, 'Organic Social' as source UNION ALL + select 'caringbridge.org' as channel, 'Organic Social' as source UNION ALL + select 'copainsdavant.linternaute.com' as channel, 'Organic Social' as source UNION ALL + select 'dianping' as channel, 'Organic Social' as source UNION ALL + select 'draft.blogger.com' as channel, 'Organic Social' as source UNION ALL + select 'fanpop.com' as channel, 'Organic Social' as source UNION ALL + select 'forums.nexopia.com' as channel, 'Organic Social' as source UNION ALL + select 'gaiaonline' as channel, 'Organic Social' as source UNION ALL + select 'goo.gl' as channel, 'Organic Social' as source UNION ALL + select 'hootsuite' as channel, 'Organic Social' as source UNION ALL + select 'imvu' as channel, 'Organic Social' as source UNION ALL + select 'jappy.de' as channel, 'Organic Social' as source UNION ALL + select 'listal' as channel, 'Organic Social' as source UNION ALL + select 'meetup' as channel, 'Organic Social' as source UNION ALL + select 'mubi.com' as channel, 'Organic Social' as source UNION ALL + select 'nightlifelink' as channel, 'Organic Social' as source UNION ALL + select 'photobucket' as channel, 'Organic Social' as source UNION ALL + select 'pinterest.it' as channel, 'Organic Social' as source UNION ALL + select 'pulse.yahoo.com' as channel, 'Organic Social' as source UNION ALL + select 'reunion.com' as channel, 'Organic Social' as source UNION ALL + select 'shvoong.com' as channel, 'Organic Social' as source UNION ALL + select 'stackapps.com' as channel, 'Organic Social' as source UNION ALL + select 'taggedmail.com' as channel, 'Organic Social' as source UNION ALL + select 'tudou.com' as channel, 'Organic Social' as source UNION ALL + select 'video.ibm.com' as channel, 'Organic Social' as source UNION ALL + select 'wiki.answers.com' as channel, 'Organic Social' as source UNION ALL + select 'zooppa.com' as channel, 'Organic Social' as source UNION ALL + select 'allrecipes.com' as channel, 'Organic Social' as source UNION ALL + select 'askubuntu' as channel, 'Organic Social' as source UNION ALL + select 'beforeitsnews.com' as channel, 'Organic Social' as source UNION ALL + select 'blogger.com' as channel, 'Organic Social' as source UNION ALL + select 'brightkite.com' as channel, 'Organic Social' as source UNION ALL + select 'catster' as channel, 'Organic Social' as source ;; + } + + measure: count { + type: count + drill_fields: [detail*] + } + + dimension: channel { + type: string + sql: ${TABLE}.channel ;; + } + + dimension: source { + type: string + sql: ${TABLE}.source ;; + } + + set: detail { + fields: [ + channel, + source + ] + } +} diff --git a/views/attribution_sources/organic_video.view.lkml b/views/attribution_sources/organic_video.view.lkml new file mode 100644 index 0000000..7d35623 --- /dev/null +++ b/views/attribution_sources/organic_video.view.lkml @@ -0,0 +1,73 @@ +view: organic_video { + derived_table: { + datagroup_trigger:attribution_channel + sql: select 'blog.twitch.tv' as channel, 'Organic Video' as source UNION ALL + select 'dailymotion.com' as channel, 'Organic Video' as source UNION ALL + select 'help.netflix.com' as channel, 'Organic Video' as source UNION ALL + select 'justin.tv' as channel, 'Organic Video' as source UNION ALL + select 'player.vimeo.com' as channel, 'Organic Video' as source UNION ALL + select 'vimeo' as channel, 'Organic Video' as source UNION ALL + select 'crackle' as channel, 'Organic Video' as source UNION ALL + select 'dashboard.twitch.tv' as channel, 'Organic Video' as source UNION ALL + select 'hulu' as channel, 'Organic Video' as source UNION ALL + select 'm.twitch.tv' as channel, 'Organic Video' as source UNION ALL + select 'ted' as channel, 'Organic Video' as source UNION ALL + select 'vimeo.com' as channel, 'Organic Video' as source UNION ALL + select 'crackle.com' as channel, 'Organic Video' as source UNION ALL + select 'disneyplus' as channel, 'Organic Video' as source UNION ALL + select 'hulu.com' as channel, 'Organic Video' as source UNION ALL + select 'm.youtube.com' as channel, 'Organic Video' as source UNION ALL + select 'ted.com' as channel, 'Organic Video' as source UNION ALL + select 'wistia' as channel, 'Organic Video' as source UNION ALL + select 'curiositystream' as channel, 'Organic Video' as source UNION ALL + select 'disneyplus.com' as channel, 'Organic Video' as source UNION ALL + select 'id.twitch.tv' as channel, 'Organic Video' as source UNION ALL + select 'music.youtube.com' as channel, 'Organic Video' as source UNION ALL + select 'twitch' as channel, 'Organic Video' as source UNION ALL + select 'wistia.com' as channel, 'Organic Video' as source UNION ALL + select 'curiositystream.com' as channel, 'Organic Video' as source UNION ALL + select 'fast.wistia.net' as channel, 'Organic Video' as source UNION ALL + select 'iq.com' as channel, 'Organic Video' as source UNION ALL + select 'netflix' as channel, 'Organic Video' as source UNION ALL + select 'twitch.tv' as channel, 'Organic Video' as source UNION ALL + select 'youku' as channel, 'Organic Video' as source UNION ALL + select 'd.tube' as channel, 'Organic Video' as source UNION ALL + select 'help.hulu.com' as channel, 'Organic Video' as source UNION ALL + select 'iqiyi' as channel, 'Organic Video' as source UNION ALL + select 'netflix.com' as channel, 'Organic Video' as source UNION ALL + select 'utreon' as channel, 'Organic Video' as source UNION ALL + select 'youku.com' as channel, 'Organic Video' as source UNION ALL + select 'iqiyi.com' as channel, 'Organic Video' as source UNION ALL + select 'player.twitch.tv' as channel, 'Organic Video' as source UNION ALL + select 'utreon.com' as channel, 'Organic Video' as source UNION ALL + select 'youtube' as channel, 'Organic Video' as source UNION ALL + select 'dailymotion' as channel, 'Organic Video' as source UNION ALL + select 'jobs.netflix.com' as channel, 'Organic Video' as source UNION ALL + select 'veoh' as channel, 'Organic Video' as source UNION ALL + select 'youtube.com' as channel, 'Organic Video' as source UNION ALL + select 'veoh.com' as channel, 'Organic Video' as source UNION ALL + select 'viadeo.journaldunet.com' as channel, 'Organic Video' as source ;; + } + + measure: count { + type: count + drill_fields: [detail*] + } + + dimension: channel { + type: string + sql: ${TABLE}.channel ;; + } + + dimension: source { + type: string + sql: ${TABLE}.source ;; + } + + set: detail { + fields: [ + channel, + source + ] + } +} diff --git a/views/attribution_sources/others.view.lkml b/views/attribution_sources/others.view.lkml new file mode 100644 index 0000000..c0d29e1 --- /dev/null +++ b/views/attribution_sources/others.view.lkml @@ -0,0 +1,37 @@ +view: others { + derived_table: { + datagroup_trigger:attribution_channel + sql: select '(direct)' as medium, 'Direct' as source UNION ALL +select '(direct)(none)' as medium, 'Direct' as source UNION ALL + select 'referral' as medium, 'Referral' as source UNION ALL + select 'audio' as medium, 'Audio' as source UNION ALL + select 'sms' as medium, 'SMS' as source UNION ALL + select 'mobile' as medium, 'Mobile' as source UNION ALL + select 'push' as medium, 'Mobile Push Notifications' as source UNION ALL + select 'affiliate' as medium, 'Affiliates' as source UNION ALL + select 'email' as medium, 'Email' as source UNION ALL + select 'cross network' as medium, 'Cross Network' as source;; + } + + measure: count { + type: count + drill_fields: [detail*] + } + + dimension: medium { + type: string + sql: ${TABLE}.medium ;; + } + + dimension: source { + type: string + sql: ${TABLE}.source ;; + } + + set: detail { + fields: [ + medium, + source + ] + } +} diff --git a/views/attribution_sources/paid_search.view.lkml b/views/attribution_sources/paid_search.view.lkml new file mode 100644 index 0000000..c152199 --- /dev/null +++ b/views/attribution_sources/paid_search.view.lkml @@ -0,0 +1,157 @@ +view: paid_search { + derived_table: { + datagroup_trigger:attribution_channel + sql: select '360.cn'as channel, 'Paid Search' as source UNION ALL + select 'babylon'as channel, 'Paid Search' as source UNION ALL + select 'centrum.cz'as channel, 'Paid Search' as source UNION ALL + select 'conduit'as channel, 'Paid Search' as source UNION ALL + select 'duckduckgo'as channel, 'Paid Search' as source UNION ALL + select 'excite.com'as channel, 'Paid Search' as source UNION ALL + select 'google.com'as channel, 'Paid Search' as source UNION ALL + select 'it.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'mail.google.com'as channel, 'Paid Search' as source UNION ALL + select 'najdi'as channel, 'Paid Search' as source UNION ALL + select 'onet'as channel, 'Paid Search' as source UNION ALL + select 'rambler'as channel, 'Paid Search' as source UNION ALL + select 'search.smt.docomo.ne.jp'as channel, 'Paid Search' as source UNION ALL + select 'sogou.com'as channel, 'Paid Search' as source UNION ALL + select 'tr.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'vn.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'yandex'as channel, 'Paid Search' as source UNION ALL + select 'alice'as channel, 'Paid Search' as source UNION ALL + select 'baidu'as channel, 'Paid Search' as source UNION ALL + select 'ch.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'cse.google.com'as channel, 'Paid Search' as source UNION ALL + select 'ecosia.org'as channel, 'Paid Search' as source UNION ALL + select 'fi.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'googlemybusiness'as channel, 'Paid Search' as source UNION ALL + select 'kvasir'as channel, 'Paid Search' as source UNION ALL + select 'mail.rambler.ru'as channel, 'Paid Search' as source UNION ALL + select 'naver'as channel, 'Paid Search' as source UNION ALL + select 'onet.pl'as channel, 'Paid Search' as source UNION ALL + select 'rambler.ru'as channel, 'Paid Search' as source UNION ALL + select 'search.ukr.net'as channel, 'Paid Search' as source UNION ALL + select 'sp-web.search.auone.jp'as channel, 'Paid Search' as source UNION ALL + select 'tut.by'as channel, 'Paid Search' as source UNION ALL + select 'wap.sogou.com'as channel, 'Paid Search' as source UNION ALL + select 'yandex.by'as channel, 'Paid Search' as source UNION ALL + select 'aol'as channel, 'Paid Search' as source UNION ALL + select 'biglobe'as channel, 'Paid Search' as source UNION ALL + select 'cl.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'daum'as channel, 'Paid Search' as source UNION ALL + select 'email.seznam.cz'as channel, 'Paid Search' as source UNION ALL + select 'firmy.cz'as channel, 'Paid Search' as source UNION ALL + select 'hk.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'lite.qwant.com'as channel, 'Paid Search' as source UNION ALL + select 'mail.yandex.ru'as channel, 'Paid Search' as source UNION ALL + select 'naver.com'as channel, 'Paid Search' as source UNION ALL + select 'pe.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'se.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'secureurl.ukr.net'as channel, 'Paid Search' as source UNION ALL + select 'startsiden'as channel, 'Paid Search' as source UNION ALL + select 'tw.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'webmaster.yandex.ru'as channel, 'Paid Search' as source UNION ALL + select 'yandex.com'as channel, 'Paid Search' as source UNION ALL + select 'ar.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'biglobe.co.jp'as channel, 'Paid Search' as source UNION ALL + select 'cn.bing.com'as channel, 'Paid Search' as source UNION ALL + select 'daum.net'as channel, 'Paid Search' as source UNION ALL + select 'eniro'as channel, 'Paid Search' as source UNION ALL + select 'fr.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'id.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'lycos'as channel, 'Paid Search' as source UNION ALL + select 'malaysia.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'news.google.com'as channel, 'Paid Search' as source UNION ALL + select 'ph.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'search-results'as channel, 'Paid Search' as source UNION ALL + select 'seznam'as channel, 'Paid Search' as source UNION ALL + select 'startsiden.no'as channel, 'Paid Search' as source UNION ALL + select 'uk.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'websearch.rakuten.co.jp'as channel, 'Paid Search' as source UNION ALL + select 'yandex.com.tr'as channel, 'Paid Search' as source UNION ALL + select 'ask'as channel, 'Paid Search' as source UNION ALL + select 'biglobe.ne.jp'as channel, 'Paid Search' as source UNION ALL + select 'cnn'as channel, 'Paid Search' as source UNION ALL + select 'de.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'es.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'globo'as channel, 'Paid Search' as source UNION ALL + select 'in.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'm.baidu.com'as channel, 'Paid Search' as source UNION ALL + select 'msn'as channel, 'Paid Search' as source UNION ALL + select 'nl.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'pl.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'search.aol.co.uk'as channel, 'Paid Search' as source UNION ALL + select 'seznam.cz'as channel, 'Paid Search' as source UNION ALL + select 'suche.aol.de'as channel, 'Paid Search' as source UNION ALL + select 'ukr'as channel, 'Paid Search' as source UNION ALL + select 'yahoo'as channel, 'Paid Search' as source UNION ALL + select 'yandex.fr'as channel, 'Paid Search' as source UNION ALL + select 'at.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'bing'as channel, 'Paid Search' as source UNION ALL + select 'co.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'dk.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'espanol.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'go.mail.ru'as channel, 'Paid Search' as source UNION ALL + select 'incredimail'as channel, 'Paid Search' as source UNION ALL + select 'm.naver.com'as channel, 'Paid Search' as source UNION ALL + select 'msn.com'as channel, 'Paid Search' as source UNION ALL + select 'no.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'qwant'as channel, 'Paid Search' as source UNION ALL + select 'search.aol.com'as channel, 'Paid Search' as source UNION ALL + select 'sg.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'terra'as channel, 'Paid Search' as source UNION ALL + select 'us.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'yahoo.co.jp'as channel, 'Paid Search' as source UNION ALL + select 'yandex.kz'as channel, 'Paid Search' as source UNION ALL + select 'au.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'br.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'comcast'as channel, 'Paid Search' as source UNION ALL + select 'dogpile'as channel, 'Paid Search' as source UNION ALL + select 'exalead.com'as channel, 'Paid Search' as source UNION ALL + select 'google'as channel, 'Paid Search' as source UNION ALL + select 'm.search.naver.com'as channel, 'Paid Search' as source UNION ALL + select 'mx.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'ntp.msn.com'as channel, 'Paid Search' as source UNION ALL + select 'qwant.com'as channel, 'Paid Search' as source UNION ALL + select 'search.google.com'as channel, 'Paid Search' as source UNION ALL + select 'so.com'as channel, 'Paid Search' as source UNION ALL + select 'th.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'virgilio'as channel, 'Paid Search' as source UNION ALL + select 'yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'yandex.ru'as channel, 'Paid Search' as source UNION ALL + select 'auone'as channel, 'Paid Search' as source UNION ALL + select 'ca.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'dogpile.com'as channel, 'Paid Search' as source UNION ALL + select 'google-play'as channel, 'Paid Search' as source UNION ALL + select 'm.sogou.com'as channel, 'Paid Search' as source UNION ALL + select 'nz.search.yahoo.com'as channel, 'Paid Search' as source UNION ALL + select 'rakuten'as channel, 'Paid Search' as source UNION ALL + select 'sogou'as channel, 'Paid Search' as source UNION ALL + select 'yandex.ua'as channel, 'Paid Search' as source UNION ALL + select 'avg'as channel, 'Paid Search' as source UNION ALL + select 'rakuten.co.jp'as channel, 'Paid Search' as source UNION ALL + select 'yandex.uz'as channel, 'Paid Search' as source ;; + } + + measure: count { + type: count + drill_fields: [detail*] + } + + dimension: channel { + type: string + sql: ${TABLE}.channel ;; + } + + dimension: source { + type: string + sql: ${TABLE}.source ;; + } + + set: detail { + fields: [ + channel, + source + ] + } +} diff --git a/views/attribution_sources/paid_shopping.view.lkml b/views/attribution_sources/paid_shopping.view.lkml new file mode 100644 index 0000000..e0aa8f6 --- /dev/null +++ b/views/attribution_sources/paid_shopping.view.lkml @@ -0,0 +1,70 @@ +view: paid_shopping +{ + derived_table: { + datagroup_trigger:attribution_channel + sql: select 'Google Shopping' as channel, 'Paid Channel' as source UNION ALL + select 'IGShopping' as channel, 'Paid Channel' as source UNION ALL + select 'aax-us-east.amazon-adsystem.com' as channel, 'Paid Channel' as source UNION ALL + select 'aax.amazon-adsystem.com' as channel, 'Paid Channel' as source UNION ALL + select 'alibaba' as channel, 'Paid Channel' as source UNION ALL + select 'alibaba.com' as channel, 'Paid Channel' as source UNION ALL + select 'amazon' as channel, 'Paid Channel' as source UNION ALL + select 'amazon.co.uk' as channel, 'Paid Channel' as source UNION ALL + select 'amazon.com' as channel, 'Paid Channel' as source UNION ALL + select 'apps.shopify.com' as channel, 'Paid Channel' as source UNION ALL + select 'checkout.shopify.com' as channel, 'Paid Channel' as source UNION ALL + select 'checkout.stripe.com' as channel, 'Paid Channel' as source UNION ALL + select 'cr.shopping.naver.com' as channel, 'Paid Channel' as source UNION ALL + select 'cr2.shopping.naver.com' as channel, 'Paid Channel' as source UNION ALL + select 'ebay' as channel, 'Paid Channel' as source UNION ALL + select 'ebay.co.uk' as channel, 'Paid Channel' as source UNION ALL + select 'ebay.com' as channel, 'Paid Channel' as source UNION ALL + select 'ebay.com.au' as channel, 'Paid Channel' as source UNION ALL + select 'ebay.de' as channel, 'Paid Channel' as source UNION ALL + select 'etsy' as channel, 'Paid Channel' as source UNION ALL + select 'etsy.com' as channel, 'Paid Channel' as source UNION ALL + select 'm.alibaba.com' as channel, 'Paid Channel' as source UNION ALL + select 'm.shopping.naver.com' as channel, 'Paid Channel' as source UNION ALL + select 'mercadolibre' as channel, 'Paid Channel' as source UNION ALL + select 'mercadolibre.com' as channel, 'Paid Channel' as source UNION ALL + select 'mercadolibre.com.ar' as channel, 'Paid Channel' as source UNION ALL + select 'mercadolibre.com.mx' as channel, 'Paid Channel' as source UNION ALL + select 'one.walmart.com' as channel, 'Paid Channel' as source UNION ALL + select 'order.shopping.yahoo.co.jp' as channel, 'Paid Channel' as source UNION ALL + select 'partners.shopify.com' as channel, 'Paid Channel' as source UNION ALL + select 's3.amazonaws.com' as channel, 'Paid Channel' as source UNION ALL + select 'se.shopping.net' as channel, 'Paid Channel' as source UNION ALL + select 'shop.app' as channel, 'Paid Channel' as source UNION ALL + select 'shopify' as channel, 'Paid Channel' as source UNION ALL + select 'shopify.com' as channel, 'Paid Channel' as source UNION ALL + select 'shopping.naver.com' as channel, 'Paid Channel' as source UNION ALL + select 'shopping.yahoo.co.jp' as channel, 'Paid Channel' as source UNION ALL + select 'shopping.yahoo.com' as channel, 'Paid Channel' as source UNION ALL + select 'shopzilla' as channel, 'Paid Channel' as source UNION ALL + select 'shopzilla.com' as channel, 'Paid Channel' as source UNION ALL + select 'simplycodes.com' as channel, 'Paid Channel' as source UNION ALL + select 'store.shopping.yahoo.co.jp' as channel, 'Paid Channel' as source UNION ALL + select 'stripe' as channel, 'Paid Channel' as source UNION ALL + select 'stripe.com' as channel, 'Paid Channel' as source UNION ALL + select 'uk.shopping.net' as channel, 'Paid Channel' as source UNION ALL + select 'walmart' as channel, 'Paid Channel' as source UNION ALL + select 'walmart.com' as channel, 'Paid Channel' as source ;; + } + + dimension: channel { + type: string + sql: ${TABLE}.channel ;; + } + + dimension: source { + type: string + sql: ${TABLE}.source ;; + } + + set: detail { + fields: [ + channel, + source + ] + } +} diff --git a/views/attribution_sources/paid_social.view.lkml b/views/attribution_sources/paid_social.view.lkml new file mode 100644 index 0000000..276e29f --- /dev/null +++ b/views/attribution_sources/paid_social.view.lkml @@ -0,0 +1,499 @@ +view: paid_social { + derived_table: { + datagroup_trigger:attribution_channel + sql: select '43things' as channel, 'Paid Social' as source UNION ALL + select 'ameblo.jp' as channel, 'Paid Social' as source UNION ALL + select 'askubuntu.com' as channel, 'Paid Social' as source UNION ALL + select 'biip.no' as channel, 'Paid Social' as source UNION ALL + select 'bloglines' as channel, 'Paid Social' as source UNION ALL + select 'business.facebook.com' as channel, 'Paid Social' as source UNION ALL + select 'cellufun.com' as channel, 'Paid Social' as source UNION ALL + select 'couchsurfing.org' as channel, 'Paid Social' as source UNION ALL + select 'diigo.com' as channel, 'Paid Social' as source UNION ALL + select 'edublogs.org' as channel, 'Paid Social' as source UNION ALL + select 'feministing.com' as channel, 'Paid Social' as source UNION ALL + select 'forums.webosnation.com' as channel, 'Paid Social' as source UNION ALL + select 'gamerdna' as channel, 'Paid Social' as source UNION ALL + select 'googlegroups.com' as channel, 'Paid Social' as source UNION ALL + select 'hr.com' as channel, 'Paid Social' as source UNION ALL + select 'instagram.com' as channel, 'Paid Social' as source UNION ALL + select 'kaneva' as channel, 'Paid Social' as source UNION ALL + select 'livedoorblog' as channel, 'Paid Social' as source UNION ALL + select 'messages.google.com' as channel, 'Paid Social' as source UNION ALL + select 'mylife' as channel, 'Paid Social' as source UNION ALL + select 'odnoklassniki.ua' as channel, 'Paid Social' as source UNION ALL + select 'pingsta.com' as channel, 'Paid Social' as source UNION ALL + select 'pinterest.pt' as channel, 'Paid Social' as source UNION ALL + select 'quechup.com' as channel, 'Paid Social' as source UNION ALL + select 'scoop.it' as channel, 'Paid Social' as source UNION ALL + select 'slideshare.net' as channel, 'Paid Social' as source UNION ALL + select 'stardoll.com' as channel, 'Paid Social' as source UNION ALL + select 'tiktok.com' as channel, 'Paid Social' as source UNION ALL + select 'twitter' as channel, 'Paid Social' as source UNION ALL + select 'web.skype.com' as channel, 'Paid Social' as source UNION ALL + select 'xanga.com' as channel, 'Paid Social' as source UNION ALL + select '43things.com' as channel, 'Paid Social' as source UNION ALL + select 'americantowns' as channel, 'Paid Social' as source UNION ALL + select 'asmallworld.com' as channel, 'Paid Social' as source UNION ALL + select 'biswap.org' as channel, 'Paid Social' as source UNION ALL + select 'bloglines.com' as channel, 'Paid Social' as source UNION ALL + select 'buzzfeed' as channel, 'Paid Social' as source UNION ALL + select 'centerblog.net' as channel, 'Paid Social' as source UNION ALL + select 'cozycot' as channel, 'Paid Social' as source UNION ALL + select 'discover.hubpages.com' as channel, 'Paid Social' as source UNION ALL + select 'elftown' as channel, 'Paid Social' as source UNION ALL + select 'filmaffinity' as channel, 'Paid Social' as source UNION ALL + select 'forums.wpcentral.com' as channel, 'Paid Social' as source UNION ALL + select 'gamerdna.com' as channel, 'Paid Social' as source UNION ALL + select 'googleplus' as channel, 'Paid Social' as source UNION ALL + select 'hu.pinterest.com' as channel, 'Paid Social' as source UNION ALL + select 'instapaper' as channel, 'Paid Social' as source UNION ALL + select 'kaneva.com' as channel, 'Paid Social' as source UNION ALL + select 'livejournal' as channel, 'Paid Social' as source UNION ALL + select 'messages.yahoo.co.jp' as channel, 'Paid Social' as source UNION ALL + select 'mylife.com' as channel, 'Paid Social' as source UNION ALL + select 'okwave.jp' as channel, 'Paid Social' as source UNION ALL + select 'pinterest' as channel, 'Paid Social' as source UNION ALL + select 'pinterest.ru' as channel, 'Paid Social' as source UNION ALL + select 'quora' as channel, 'Paid Social' as source UNION ALL + select 'screenrant' as channel, 'Paid Social' as source UNION ALL + select 'smartnews.com' as channel, 'Paid Social' as source UNION ALL + select 'stickam' as channel, 'Paid Social' as source UNION ALL + select 'tinyurl' as channel, 'Paid Social' as source UNION ALL + select 'twitter.com' as channel, 'Paid Social' as source UNION ALL + select 'webshots' as channel, 'Paid Social' as source UNION ALL + select 'xing' as channel, 'Paid Social' as source UNION ALL + select '51.com' as channel, 'Paid Social' as source UNION ALL + select 'americantowns.com' as channel, 'Paid Social' as source UNION ALL + select 'athlinks' as channel, 'Paid Social' as source UNION ALL + select 'bit.ly' as channel, 'Paid Social' as source UNION ALL + select 'blogs.com' as channel, 'Paid Social' as source UNION ALL + select 'buzzfeed.com' as channel, 'Paid Social' as source UNION ALL + select 'chat.zalo.me' as channel, 'Paid Social' as source UNION ALL + select 'cozycot.com' as channel, 'Paid Social' as source UNION ALL + select 'disqus' as channel, 'Paid Social' as source UNION ALL + select 'elftown.com' as channel, 'Paid Social' as source UNION ALL + select 'filmaffinity.com' as channel, 'Paid Social' as source UNION ALL + select 'fotki' as channel, 'Paid Social' as source UNION ALL + select 'gather.com' as channel, 'Paid Social' as source UNION ALL + select 'govloop' as channel, 'Paid Social' as source UNION ALL + select 'hubculture' as channel, 'Paid Social' as source UNION ALL + select 'instapaper.com' as channel, 'Paid Social' as source UNION ALL + select 'kin.naver.com' as channel, 'Paid Social' as source UNION ALL + select 'livejournal.com' as channel, 'Paid Social' as source UNION ALL + select 'messenger' as channel, 'Paid Social' as source UNION ALL + select 'mymodernmet' as channel, 'Paid Social' as source UNION ALL + select 'old.reddit.com' as channel, 'Paid Social' as source UNION ALL + select 'pinterest.at' as channel, 'Paid Social' as source UNION ALL + select 'pinterest.se' as channel, 'Paid Social' as source UNION ALL + select 'quora.com' as channel, 'Paid Social' as source UNION ALL + select 'screenrant.com' as channel, 'Paid Social' as source UNION ALL + select 'snapchat' as channel, 'Paid Social' as source UNION ALL + select 'stickam.com' as channel, 'Paid Social' as source UNION ALL + select 'tinyurl.com' as channel, 'Paid Social' as source UNION ALL + select 'twoo.com' as channel, 'Paid Social' as source UNION ALL + select 'webshots.com' as channel, 'Paid Social' as source UNION ALL + select 'xing.com' as channel, 'Paid Social' as source UNION ALL + select '5ch.net' as channel, 'Paid Social' as source UNION ALL + select 'amp.reddit.com' as channel, 'Paid Social' as source UNION ALL + select 'athlinks.com' as channel, 'Paid Social' as source UNION ALL + select 'blackcareernetwork.com' as channel, 'Paid Social' as source UNION ALL + select 'blogsome' as channel, 'Paid Social' as source UNION ALL + select 'buzznet' as channel, 'Paid Social' as source UNION ALL + select 'chegg.com' as channel, 'Paid Social' as source UNION ALL + select 'cross.tv' as channel, 'Paid Social' as source UNION ALL + select 'disqus.com' as channel, 'Paid Social' as source UNION ALL + select 'epicurious.com' as channel, 'Paid Social' as source UNION ALL + select 'flickr' as channel, 'Paid Social' as source UNION ALL + select 'fotki.com' as channel, 'Paid Social' as source UNION ALL + select 'geni.com' as channel, 'Paid Social' as source UNION ALL + select 'govloop.com' as channel, 'Paid Social' as source UNION ALL + select 'hubculture.com' as channel, 'Paid Social' as source UNION ALL + select 'internations.org' as channel, 'Paid Social' as source UNION ALL + select 'l.facebook.com' as channel, 'Paid Social' as source UNION ALL + select 'lm.facebook.com' as channel, 'Paid Social' as source UNION ALL + select 'messenger.com' as channel, 'Paid Social' as source UNION ALL + select 'mymodernmet.com' as channel, 'Paid Social' as source UNION ALL + select 'oneworldgroup.org' as channel, 'Paid Social' as source UNION ALL + select 'pinterest.ca' as channel, 'Paid Social' as source UNION ALL + select 'pixiv.net' as channel, 'Paid Social' as source UNION ALL + select 'qzone.qq.com' as channel, 'Paid Social' as source UNION ALL + select 'scribd' as channel, 'Paid Social' as source UNION ALL + select 'snapchat.com' as channel, 'Paid Social' as source UNION ALL + select 'studivz.net' as channel, 'Paid Social' as source UNION ALL + select 'toolbox' as channel, 'Paid Social' as source UNION ALL + select 'typepad' as channel, 'Paid Social' as source UNION ALL + select 'wechat' as channel, 'Paid Social' as source UNION ALL + select 'yahoo-mbga.jp' as channel, 'Paid Social' as source UNION ALL + select 'Hatena' as channel, 'Paid Social' as source UNION ALL + select 'ancestry.com' as channel, 'Paid Social' as source UNION ALL + select 'away.vk.com' as channel, 'Paid Social' as source UNION ALL + select 'blackplanet' as channel, 'Paid Social' as source UNION ALL + select 'blogsome.com' as channel, 'Paid Social' as source UNION ALL + select 'buzznet.com' as channel, 'Paid Social' as source UNION ALL + select 'chicagonow' as channel, 'Paid Social' as source UNION ALL + select 'crunchyroll' as channel, 'Paid Social' as source UNION ALL + select 'dogster' as channel, 'Paid Social' as source UNION ALL + select 'everforo.com' as channel, 'Paid Social' as source UNION ALL + select 'flickr.com' as channel, 'Paid Social' as source UNION ALL + select 'fotolog' as channel, 'Paid Social' as source UNION ALL + select 'getpocket.com' as channel, 'Paid Social' as source UNION ALL + select 'gowalla' as channel, 'Paid Social' as source UNION ALL + select 'hubpages.com' as channel, 'Paid Social' as source UNION ALL + select 'interpals.net' as channel, 'Paid Social' as source UNION ALL + select 'l.instagram.com' as channel, 'Paid Social' as source UNION ALL + select 'lnkd.in' as channel, 'Paid Social' as source UNION ALL + select 'mix.com' as channel, 'Paid Social' as source UNION ALL + select 'myspace' as channel, 'Paid Social' as source UNION ALL + select 'onstartups' as channel, 'Paid Social' as source UNION ALL + select 'pinterest.ch' as channel, 'Paid Social' as source UNION ALL + select 'pl.pinterest.com' as channel, 'Paid Social' as source UNION ALL + select 'ravelry' as channel, 'Paid Social' as source UNION ALL + select 'scribd.com' as channel, 'Paid Social' as source UNION ALL + select 'sociallife.com.br' as channel, 'Paid Social' as source UNION ALL + select 'suomi24.fi' as channel, 'Paid Social' as source UNION ALL + select 'toolbox.com' as channel, 'Paid Social' as source UNION ALL + select 'typepad.com' as channel, 'Paid Social' as source UNION ALL + select 'wechat.com' as channel, 'Paid Social' as source UNION ALL + select 'yammer' as channel, 'Paid Social' as source UNION ALL + select 'ImageShack' as channel, 'Paid Social' as source UNION ALL + select 'anobii' as channel, 'Paid Social' as source UNION ALL + select 'awe.sm' as channel, 'Paid Social' as source UNION ALL + select 'blackplanet.com' as channel, 'Paid Social' as source UNION ALL + select 'blogspot' as channel, 'Paid Social' as source UNION ALL + select 'cafe.naver.com' as channel, 'Paid Social' as source UNION ALL + select 'chicagonow.com' as channel, 'Paid Social' as source UNION ALL + select 'crunchyroll.com' as channel, 'Paid Social' as source UNION ALL + select 'dogster.com' as channel, 'Paid Social' as source UNION ALL + select 'exblog.jp' as channel, 'Paid Social' as source UNION ALL + select 'flipboard' as channel, 'Paid Social' as source UNION ALL + select 'fotolog.com' as channel, 'Paid Social' as source UNION ALL + select 'glassboard' as channel, 'Paid Social' as source UNION ALL + select 'gowalla.com' as channel, 'Paid Social' as source UNION ALL + select 'hyves.net' as channel, 'Paid Social' as source UNION ALL + select 'intherooms' as channel, 'Paid Social' as source UNION ALL + select 'l.messenger.com' as channel, 'Paid Social' as source UNION ALL + select 'm.blog.naver.com' as channel, 'Paid Social' as source UNION ALL + select 'mixi.jp' as channel, 'Paid Social' as source UNION ALL + select 'myspace.com' as channel, 'Paid Social' as source UNION ALL + select 'onstartups.com' as channel, 'Paid Social' as source UNION ALL + select 'pinterest.cl' as channel, 'Paid Social' as source UNION ALL + select 'playahead.se' as channel, 'Paid Social' as source UNION ALL + select 'ravelry.com' as channel, 'Paid Social' as source UNION ALL + select 'scvngr' as channel, 'Paid Social' as source UNION ALL + select 'socialvibe' as channel, 'Paid Social' as source UNION ALL + select 'superuser' as channel, 'Paid Social' as source UNION ALL + select 'touch.facebook.com' as channel, 'Paid Social' as source UNION ALL + select 'unblog.fr' as channel, 'Paid Social' as source UNION ALL + select 'weebly' as channel, 'Paid Social' as source UNION ALL + select 'yammer.com' as channel, 'Paid Social' as source UNION ALL + select 'academia.edu' as channel, 'Paid Social' as source UNION ALL + select 'anobii.com' as channel, 'Paid Social' as source UNION ALL + select 'b.hatena.ne.jp' as channel, 'Paid Social' as source UNION ALL + select 'blip.fm' as channel, 'Paid Social' as source UNION ALL + select 'blogspot.com' as channel, 'Paid Social' as source UNION ALL + select 'cafemom' as channel, 'Paid Social' as source UNION ALL + select 'chiebukuro.yahoo.co.jp' as channel, 'Paid Social' as source UNION ALL + select 'cyworld' as channel, 'Paid Social' as source UNION ALL + select 'dol2day' as channel, 'Paid Social' as source UNION ALL + select 'extole' as channel, 'Paid Social' as source UNION ALL + select 'flipboard.com' as channel, 'Paid Social' as source UNION ALL + select 'foursquare' as channel, 'Paid Social' as source UNION ALL + select 'glassboard.com' as channel, 'Paid Social' as source UNION ALL + select 'gree.jp' as channel, 'Paid Social' as source UNION ALL + select 'hyves.nl' as channel, 'Paid Social' as source UNION ALL + select 'intherooms.com' as channel, 'Paid Social' as source UNION ALL + select 'last.fm' as channel, 'Paid Social' as source UNION ALL + select 'm.cafe.naver.com' as channel, 'Paid Social' as source UNION ALL + select 'mobile.facebook.com' as channel, 'Paid Social' as source UNION ALL + select 'netvibes' as channel, 'Paid Social' as source UNION ALL + select 'opendiary' as channel, 'Paid Social' as source UNION ALL + select 'pinterest.co.kr' as channel, 'Paid Social' as source UNION ALL + select 'plurk' as channel, 'Paid Social' as source UNION ALL + select 'reddit' as channel, 'Paid Social' as source UNION ALL + select 'scvngr.com' as channel, 'Paid Social' as source UNION ALL + select 'socialvibe.com' as channel, 'Paid Social' as source UNION ALL + select 'superuser.com' as channel, 'Paid Social' as source UNION ALL + select 'tr.pinterest.com' as channel, 'Paid Social' as source UNION ALL + select 'urbanspoon.com' as channel, 'Paid Social' as source UNION ALL + select 'weebly.com' as channel, 'Paid Social' as source UNION ALL + select 'yelp' as channel, 'Paid Social' as source UNION ALL + select 'activerain' as channel, 'Paid Social' as source UNION ALL + select 'answerbag' as channel, 'Paid Social' as source UNION ALL + select 'baby-gaga' as channel, 'Paid Social' as source UNION ALL + select 'blog.com' as channel, 'Paid Social' as source UNION ALL + select 'blogster' as channel, 'Paid Social' as source UNION ALL + select 'cafemom.com' as channel, 'Paid Social' as source UNION ALL + select 'classmates' as channel, 'Paid Social' as source UNION ALL + select 'cyworld.com' as channel, 'Paid Social' as source UNION ALL + select 'dol2day.com' as channel, 'Paid Social' as source UNION ALL + select 'extole.com' as channel, 'Paid Social' as source UNION ALL + select 'folkdirect' as channel, 'Paid Social' as source UNION ALL + select 'foursquare.com' as channel, 'Paid Social' as source UNION ALL + select 'glassdoor' as channel, 'Paid Social' as source UNION ALL + select 'groups.google.com' as channel, 'Paid Social' as source UNION ALL + select 'ibibo' as channel, 'Paid Social' as source UNION ALL + select 'irc-galleria.net' as channel, 'Paid Social' as source UNION ALL + select 'librarything' as channel, 'Paid Social' as source UNION ALL + select 'm.facebook.com' as channel, 'Paid Social' as source UNION ALL + select 'mocospace' as channel, 'Paid Social' as source UNION ALL + select 'netvibes.com' as channel, 'Paid Social' as source UNION ALL + select 'opendiary.com' as channel, 'Paid Social' as source UNION ALL + select 'pinterest.co.uk' as channel, 'Paid Social' as source UNION ALL + select 'plurk.com' as channel, 'Paid Social' as source UNION ALL + select 'reddit.com' as channel, 'Paid Social' as source UNION ALL + select 'secondlife' as channel, 'Paid Social' as source UNION ALL + select 'spaces.live.com' as channel, 'Paid Social' as source UNION ALL + select 'sweeva' as channel, 'Paid Social' as source UNION ALL + select 'travellerspoint' as channel, 'Paid Social' as source UNION ALL + select 'ushareit.com' as channel, 'Paid Social' as source UNION ALL + select 'weibo' as channel, 'Paid Social' as source UNION ALL + select 'yelp.co.uk' as channel, 'Paid Social' as source UNION ALL + select 'activerain.com' as channel, 'Paid Social' as source UNION ALL + select 'answerbag.com' as channel, 'Paid Social' as source UNION ALL + select 'baby-gaga.com' as channel, 'Paid Social' as source UNION ALL + select 'blog.feedspot.com' as channel, 'Paid Social' as source UNION ALL + select 'blogster.com' as channel, 'Paid Social' as source UNION ALL + select 'camospace' as channel, 'Paid Social' as source UNION ALL + select 'classmates.com' as channel, 'Paid Social' as source UNION ALL + select 'cz.pinterest.com' as channel, 'Paid Social' as source UNION ALL + select 'doostang' as channel, 'Paid Social' as source UNION ALL + select 'facebook' as channel, 'Paid Social' as source UNION ALL + select 'folkdirect.com' as channel, 'Paid Social' as source UNION ALL + select 'free.facebook.com' as channel, 'Paid Social' as source UNION ALL + select 'glassdoor.com' as channel, 'Paid Social' as source UNION ALL + select 'gulli.com' as channel, 'Paid Social' as source UNION ALL + select 'ibibo.com' as channel, 'Paid Social' as source UNION ALL + select 'is.gd' as channel, 'Paid Social' as source UNION ALL + select 'librarything.com' as channel, 'Paid Social' as source UNION ALL + select 'm.kin.naver.com' as channel, 'Paid Social' as source UNION ALL + select 'mocospace.com' as channel, 'Paid Social' as source UNION ALL + select 'news.ycombinator.com' as channel, 'Paid Social' as source UNION ALL + select 'oshiete.goo.ne.jp' as channel, 'Paid Social' as source UNION ALL + select 'pinterest.com' as channel, 'Paid Social' as source UNION ALL + select 'plus.google.com' as channel, 'Paid Social' as source UNION ALL + select 'redux' as channel, 'Paid Social' as source UNION ALL + select 'secondlife.com' as channel, 'Paid Social' as source UNION ALL + select 'spoke' as channel, 'Paid Social' as source UNION ALL + select 'sweeva.com' as channel, 'Paid Social' as source UNION ALL + select 'travellerspoint.com' as channel, 'Paid Social' as source UNION ALL + select 'ushi.cn' as channel, 'Paid Social' as source UNION ALL + select 'weibo.com' as channel, 'Paid Social' as source UNION ALL + select 'yelp.com' as channel, 'Paid Social' as source UNION ALL + select 'activeworlds' as channel, 'Paid Social' as source UNION ALL + select 'answers.yahoo.com' as channel, 'Paid Social' as source UNION ALL + select 'babyblog.ru' as channel, 'Paid Social' as source UNION ALL + select 'blog.goo.ne.jp' as channel, 'Paid Social' as source UNION ALL + select 'blurtit' as channel, 'Paid Social' as source UNION ALL + select 'camospace.com' as channel, 'Paid Social' as source UNION ALL + select 'classquest' as channel, 'Paid Social' as source UNION ALL + select 'd.hatena.ne.jp' as channel, 'Paid Social' as source UNION ALL + select 'doostang.com' as channel, 'Paid Social' as source UNION ALL + select 'facebook.com' as channel, 'Paid Social' as source UNION ALL + select 'foodservice' as channel, 'Paid Social' as source UNION ALL + select 'friendfeed' as channel, 'Paid Social' as source UNION ALL + select 'godtube' as channel, 'Paid Social' as source UNION ALL + select 'gutefrage.net' as channel, 'Paid Social' as source UNION ALL + select 'id.pinterest.com' as channel, 'Paid Social' as source UNION ALL + select 'italki' as channel, 'Paid Social' as source UNION ALL + select 'lifestream.aol.com' as channel, 'Paid Social' as source UNION ALL + select 'm.vk.com' as channel, 'Paid Social' as source UNION ALL + select 'mouthshut' as channel, 'Paid Social' as source UNION ALL + select 'newsshowcase' as channel, 'Paid Social' as source UNION ALL + select 'out.reddit.com' as channel, 'Paid Social' as source UNION ALL + select 'pinterest.com.au' as channel, 'Paid Social' as source UNION ALL + select 'plus.url.google.com' as channel, 'Paid Social' as source UNION ALL + select 'redux.com' as channel, 'Paid Social' as source UNION ALL + select 'serverfault' as channel, 'Paid Social' as source UNION ALL + select 'spoke.com' as channel, 'Paid Social' as source UNION ALL + select 't.co' as channel, 'Paid Social' as source UNION ALL + select 'tripadvisor' as channel, 'Paid Social' as source UNION ALL + select 'vampirefreaks' as channel, 'Paid Social' as source UNION ALL + select 'wer-weiss-was.de' as channel, 'Paid Social' as source UNION ALL + select 'youroom.in' as channel, 'Paid Social' as source UNION ALL + select 'activeworlds.com' as channel, 'Paid Social' as source UNION ALL + select 'aolanswers' as channel, 'Paid Social' as source UNION ALL + select 'badoo' as channel, 'Paid Social' as source UNION ALL + select 'blog.naver.com' as channel, 'Paid Social' as source UNION ALL + select 'blurtit.com' as channel, 'Paid Social' as source UNION ALL + select 'canalblog.com' as channel, 'Paid Social' as source UNION ALL + select 'classquest.com' as channel, 'Paid Social' as source UNION ALL + select 'dailystrength.org' as channel, 'Paid Social' as source UNION ALL + select 'dopplr' as channel, 'Paid Social' as source UNION ALL + select 'faceparty' as channel, 'Paid Social' as source UNION ALL + select 'foodservice.com' as channel, 'Paid Social' as source UNION ALL + select 'friendfeed.com' as channel, 'Paid Social' as source UNION ALL + select 'godtube.com' as channel, 'Paid Social' as source UNION ALL + select 'habbo' as channel, 'Paid Social' as source UNION ALL + select 'identi.ca' as channel, 'Paid Social' as source UNION ALL + select 'italki.com' as channel, 'Paid Social' as source UNION ALL + select 'line' as channel, 'Paid Social' as source UNION ALL + select 'm.yelp.com' as channel, 'Paid Social' as source UNION ALL + select 'mouthshut.com' as channel, 'Paid Social' as source UNION ALL + select 'nexopia' as channel, 'Paid Social' as source UNION ALL + select 'over-blog.com' as channel, 'Paid Social' as source UNION ALL + select 'pinterest.com.mx' as channel, 'Paid Social' as source UNION ALL + select 'pocket.co' as channel, 'Paid Social' as source UNION ALL + select 'renren' as channel, 'Paid Social' as source UNION ALL + select 'serverfault.com' as channel, 'Paid Social' as source UNION ALL + select 'spruz' as channel, 'Paid Social' as source UNION ALL + select 't.me' as channel, 'Paid Social' as source UNION ALL + select 'tripadvisor.com' as channel, 'Paid Social' as source UNION ALL + select 'vampirefreaks.com' as channel, 'Paid Social' as source UNION ALL + select 'weread' as channel, 'Paid Social' as source UNION ALL + select 'za.pinterest.com' as channel, 'Paid Social' as source UNION ALL + select 'addthis' as channel, 'Paid Social' as source UNION ALL + select 'aolanswers.com' as channel, 'Paid Social' as source UNION ALL + select 'badoo.com' as channel, 'Paid Social' as source UNION ALL + select 'blog.yahoo.co.jp' as channel, 'Paid Social' as source UNION ALL + select 'bookmarks.yahoo.co.jp' as channel, 'Paid Social' as source UNION ALL + select 'care.com' as channel, 'Paid Social' as source UNION ALL + select 'co.pinterest.com' as channel, 'Paid Social' as source UNION ALL + select 'deluxe.com' as channel, 'Paid Social' as source UNION ALL + select 'dopplr.com' as channel, 'Paid Social' as source UNION ALL + select 'faceparty.com' as channel, 'Paid Social' as source UNION ALL + select 'forums.androidcentral.com' as channel, 'Paid Social' as source UNION ALL + select 'fruehstueckstreff.org' as channel, 'Paid Social' as source UNION ALL + select 'goldenline.pl' as channel, 'Paid Social' as source UNION ALL + select 'habbo.com' as channel, 'Paid Social' as source UNION ALL + select 'ig' as channel, 'Paid Social' as source UNION ALL + select 'jammerdirect' as channel, 'Paid Social' as source UNION ALL + select 'line.me' as channel, 'Paid Social' as source UNION ALL + select 'mbga.jp' as channel, 'Paid Social' as source UNION ALL + select 'movabletype' as channel, 'Paid Social' as source UNION ALL + select 'ngopost.org' as channel, 'Paid Social' as source UNION ALL + select 'overblog.com' as channel, 'Paid Social' as source UNION ALL + select 'pinterest.de' as channel, 'Paid Social' as source UNION ALL + select 'posterous' as channel, 'Paid Social' as source UNION ALL + select 'renren.com' as channel, 'Paid Social' as source UNION ALL + select 'shareit' as channel, 'Paid Social' as source UNION ALL + select 'spruz.com' as channel, 'Paid Social' as source UNION ALL + select 'tagged' as channel, 'Paid Social' as source UNION ALL + select 'trombi' as channel, 'Paid Social' as source UNION ALL + select 'vampirerave' as channel, 'Paid Social' as source UNION ALL + select 'weread.com' as channel, 'Paid Social' as source UNION ALL + select 'zalo' as channel, 'Paid Social' as source UNION ALL + select 'addthis.com' as channel, 'Paid Social' as source UNION ALL + select 'apps.facebook.com' as channel, 'Paid Social' as source UNION ALL + select 'bebo' as channel, 'Paid Social' as source UNION ALL + select 'blogg.no' as channel, 'Paid Social' as source UNION ALL + select 'bookmarks.yahoo.com' as channel, 'Paid Social' as source UNION ALL + select 'care2' as channel, 'Paid Social' as source UNION ALL + select 'cocolog-nifty' as channel, 'Paid Social' as source UNION ALL + select 'deviantart' as channel, 'Paid Social' as source UNION ALL + select 'douban' as channel, 'Paid Social' as source UNION ALL + select 'fandom.com' as channel, 'Paid Social' as source UNION ALL + select 'forums.crackberry.com' as channel, 'Paid Social' as source UNION ALL + select 'fubar' as channel, 'Paid Social' as source UNION ALL + select 'goldstar' as channel, 'Paid Social' as source UNION ALL + select 'hi5' as channel, 'Paid Social' as source UNION ALL + select 'imageshack.com' as channel, 'Paid Social' as source UNION ALL + select 'jammerdirect.com' as channel, 'Paid Social' as source UNION ALL + select 'linkedin' as channel, 'Paid Social' as source UNION ALL + select 'medium.com' as channel, 'Paid Social' as source UNION ALL + select 'movabletype.com' as channel, 'Paid Social' as source UNION ALL + select 'niconico' as channel, 'Paid Social' as source UNION ALL + select 'paper.li' as channel, 'Paid Social' as source UNION ALL + select 'pinterest.es' as channel, 'Paid Social' as source UNION ALL + select 'posterous.com' as channel, 'Paid Social' as source UNION ALL + select 'researchgate.net' as channel, 'Paid Social' as source UNION ALL + select 'sharethis' as channel, 'Paid Social' as source UNION ALL + select 'ssense.com' as channel, 'Paid Social' as source UNION ALL + select 'tagged.com' as channel, 'Paid Social' as source UNION ALL + select 'trombi.com' as channel, 'Paid Social' as source UNION ALL + select 'vampirerave.com' as channel, 'Paid Social' as source UNION ALL + select 'whatsapp' as channel, 'Paid Social' as source UNION ALL + select 'zoo.gr' as channel, 'Paid Social' as source UNION ALL + select 'airg.ca' as channel, 'Paid Social' as source UNION ALL + select 'ar.pinterest.com' as channel, 'Paid Social' as source UNION ALL + select 'bebo.com' as channel, 'Paid Social' as source UNION ALL + select 'bloggang.com' as channel, 'Paid Social' as source UNION ALL + select 'br.pinterest.com' as channel, 'Paid Social' as source UNION ALL + select 'care2.com' as channel, 'Paid Social' as source UNION ALL + select 'cocolog-nifty.com' as channel, 'Paid Social' as source UNION ALL + select 'deviantart.com' as channel, 'Paid Social' as source UNION ALL + select 'douban.com' as channel, 'Paid Social' as source UNION ALL + select 'fanpop' as channel, 'Paid Social' as source UNION ALL + select 'forums.imore.com' as channel, 'Paid Social' as source UNION ALL + select 'fubar.com' as channel, 'Paid Social' as source UNION ALL + select 'goldstar.com' as channel, 'Paid Social' as source UNION ALL + select 'hi5.com' as channel, 'Paid Social' as source UNION ALL + select 'imageshack.us' as channel, 'Paid Social' as source UNION ALL + select 'jappy.com' as channel, 'Paid Social' as source UNION ALL + select 'linkedin.com' as channel, 'Paid Social' as source UNION ALL + select 'meetin.org' as channel, 'Paid Social' as source UNION ALL + select 'mubi' as channel, 'Paid Social' as source UNION ALL + select 'nicovideo.jp' as channel, 'Paid Social' as source UNION ALL + select 'partyflock.nl' as channel, 'Paid Social' as source UNION ALL + select 'pinterest.fr' as channel, 'Paid Social' as source UNION ALL + select 'pro.homeadvisor.com' as channel, 'Paid Social' as source UNION ALL + select 'reunion' as channel, 'Paid Social' as source UNION ALL + select 'sharethis.com' as channel, 'Paid Social' as source UNION ALL + select 'stackapps' as channel, 'Paid Social' as source UNION ALL + select 'taggedmail' as channel, 'Paid Social' as source UNION ALL + select 'tudou' as channel, 'Paid Social' as source UNION ALL + select 'vg.no' as channel, 'Paid Social' as source UNION ALL + select 'whatsapp.com' as channel, 'Paid Social' as source UNION ALL + select 'zooppa' as channel, 'Paid Social' as source UNION ALL + select 'allnurses.com' as channel, 'Paid Social' as source UNION ALL + select 'artstation.com' as channel, 'Paid Social' as source UNION ALL + select 'beforeitsnews' as channel, 'Paid Social' as source UNION ALL + select 'blogger' as channel, 'Paid Social' as source UNION ALL + select 'brightkite' as channel, 'Paid Social' as source UNION ALL + select 'caringbridge.org' as channel, 'Paid Social' as source UNION ALL + select 'copainsdavant.linternaute.com' as channel, 'Paid Social' as source UNION ALL + select 'dianping' as channel, 'Paid Social' as source UNION ALL + select 'draft.blogger.com' as channel, 'Paid Social' as source UNION ALL + select 'fanpop.com' as channel, 'Paid Social' as source UNION ALL + select 'forums.nexopia.com' as channel, 'Paid Social' as source UNION ALL + select 'gaiaonline' as channel, 'Paid Social' as source UNION ALL + select 'goo.gl' as channel, 'Paid Social' as source UNION ALL + select 'hootsuite' as channel, 'Paid Social' as source UNION ALL + select 'imvu' as channel, 'Paid Social' as source UNION ALL + select 'jappy.de' as channel, 'Paid Social' as source UNION ALL + select 'listal' as channel, 'Paid Social' as source UNION ALL + select 'meetup' as channel, 'Paid Social' as source UNION ALL + select 'mubi.com' as channel, 'Paid Social' as source UNION ALL + select 'nightlifelink' as channel, 'Paid Social' as source UNION ALL + select 'photobucket' as channel, 'Paid Social' as source UNION ALL + select 'pinterest.it' as channel, 'Paid Social' as source UNION ALL + select 'pulse.yahoo.com' as channel, 'Paid Social' as source UNION ALL + select 'reunion.com' as channel, 'Paid Social' as source UNION ALL + select 'shvoong.com' as channel, 'Paid Social' as source UNION ALL + select 'stackapps.com' as channel, 'Paid Social' as source UNION ALL + select 'taggedmail.com' as channel, 'Paid Social' as source UNION ALL + select 'tudou.com' as channel, 'Paid Social' as source UNION ALL + select 'video.ibm.com' as channel, 'Paid Social' as source UNION ALL + select 'wiki.answers.com' as channel, 'Paid Social' as source UNION ALL + select 'zooppa.com' as channel, 'Paid Social' as source UNION ALL + select 'allrecipes.com' as channel, 'Paid Social' as source UNION ALL + select 'askubuntu' as channel, 'Paid Social' as source UNION ALL + select 'beforeitsnews.com' as channel, 'Paid Social' as source UNION ALL + select 'blogger.com' as channel, 'Paid Social' as source UNION ALL + select 'brightkite.com' as channel, 'Paid Social' as source UNION ALL + select 'catster' as channel, 'Paid Social' as source ;; + } + + measure: count { + type: count + drill_fields: [detail*] + } + + dimension: channel { + type: string + sql: ${TABLE}.channel ;; + } + + dimension: source { + type: string + sql: ${TABLE}.source ;; + } + + set: detail { + fields: [ + channel, + source + ] + } + + } diff --git a/views/attribution_sources/paid_video.view.lkml b/views/attribution_sources/paid_video.view.lkml new file mode 100644 index 0000000..4833b1c --- /dev/null +++ b/views/attribution_sources/paid_video.view.lkml @@ -0,0 +1,64 @@ +view: paid_video { + derived_table: { + datagroup_trigger:attribution_channel + sql: select 'blog.twitch.tv' as channel, 'Paid Video'as source UNION ALL + select 'dailymotion.com' as channel, 'Paid Video'as source UNION ALL + select 'help.netflix.com' as channel, 'Paid Video'as source UNION ALL + select 'justin.tv' as channel, 'Paid Video'as source UNION ALL + select 'player.vimeo.com' as channel, 'Paid Video'as source UNION ALL + select 'vimeo' as channel, 'Paid Video'as source UNION ALL + select 'crackle' as channel, 'Paid Video'as source UNION ALL + select 'dashboard.twitch.tv' as channel, 'Paid Video'as source UNION ALL + select 'hulu' as channel, 'Paid Video'as source UNION ALL + select 'm.twitch.tv' as channel, 'Paid Video'as source UNION ALL + select 'ted' as channel, 'Paid Video'as source UNION ALL + select 'vimeo.com' as channel, 'Paid Video'as source UNION ALL + select 'crackle.com' as channel, 'Paid Video'as source UNION ALL + select 'disneyplus' as channel, 'Paid Video'as source UNION ALL + select 'hulu.com' as channel, 'Paid Video'as source UNION ALL + select 'm.youtube.com' as channel, 'Paid Video'as source UNION ALL + select 'ted.com' as channel, 'Paid Video'as source UNION ALL + select 'wistia' as channel, 'Paid Video'as source UNION ALL + select 'curiositystream' as channel, 'Paid Video'as source UNION ALL + select 'disneyplus.com' as channel, 'Paid Video'as source UNION ALL + select 'id.twitch.tv' as channel, 'Paid Video'as source UNION ALL + select 'music.youtube.com' as channel, 'Paid Video'as source UNION ALL + select 'twitch' as channel, 'Paid Video'as source UNION ALL + select 'wistia.com' as channel, 'Paid Video'as source UNION ALL + select 'curiositystream.com' as channel, 'Paid Video'as source UNION ALL + select 'fast.wistia.net' as channel, 'Paid Video'as source UNION ALL + select 'iq.com' as channel, 'Paid Video'as source UNION ALL + select 'netflix' as channel, 'Paid Video'as source UNION ALL + select 'twitch.tv' as channel, 'Paid Video'as source UNION ALL + select 'youku' as channel, 'Paid Video'as source UNION ALL + select 'd.tube' as channel, 'Paid Video'as source UNION ALL + select 'help.hulu.com' as channel, 'Paid Video'as source UNION ALL + select 'iqiyi' as channel, 'Paid Video'as source UNION ALL + select 'netflix.com' as channel, 'Paid Video'as source UNION ALL + select 'utreon' as channel, 'Paid Video'as source UNION ALL + select 'youku.com' as channel, 'Paid Video'as source UNION ALL + select 'dailymotion' as channel, 'Paid Video'as source ;; + } + + measure: count { + type: count + drill_fields: [detail*] + } + + dimension: channel { + type: string + sql: ${TABLE}.channel ;; + } + + dimension: source { + type: string + sql: ${TABLE}.source ;; + } + + set: detail { + fields: [ + channel, + source + ] + } +} diff --git a/views/audience_cohorts.view.lkml b/views/audience_cohorts.view.lkml new file mode 100644 index 0000000..4689e18 --- /dev/null +++ b/views/audience_cohorts.view.lkml @@ -0,0 +1,28 @@ +include: "/views/attribution_sources.view.lkml" +view: audience_cohorts { + derived_table: { + explore_source: sessions { + column: audience_trait {} + column: total_sessions {} + derived_column: rank { + sql: ROW_NUMBER() OVER() ;; + } + + bind_all_filters: yes + sorts: [sessions.total_sessions: desc] + } + } + + dimension: audience_trait { + # Field used to JOIN back to ga_sessions via ga_sessions.audience_traits = audience_cohorts.audience_traits + hidden: yes + } + + dimension: rank { + label: "Audience Trait: Rank by Traffic" + view_label: "Audience" + group_label: "Audience Cohorts" + description: "Dynamic rank for Audience Trait based on web traffic (Sessions). Includes all filters in current query and reranks on each new query." + type: number + } +} diff --git a/views/bqml/arima_event_model/forecasting.view.lkml b/views/bqml/arima_event_model/forecasting.view.lkml new file mode 100644 index 0000000..bbf42e8 --- /dev/null +++ b/views/bqml/arima_event_model/forecasting.view.lkml @@ -0,0 +1,62 @@ +include: "/views/bqml/*/*.view.lkml" +view: forecasting { + derived_table: { + sql_trigger_value: ${model_arima.SQL_TABLE_NAME} ;; + sql: SELECT * FROM ML.EXPLAIN_FORECAST(MODEL ${model_arima.SQL_TABLE_NAME}, + STRUCT(60 AS horizon, 0.8 AS confidence_level)) ;; + } + dimension: forecast_timestamp + { + primary_key: yes + type:date + sql:${TABLE}.time_series_timestamp ;; + } + dimension: events_event_name + { + label:"Forecasted Event" + type:string + sql:${TABLE}.events_event_name;; + } + dimension: forecast_value_num { + type: number + hidden: no + sql:${TABLE}.time_series_data ;; + } + dimension: se { + type: number + hidden: no + sql:${TABLE}.standard_error;; + } + dimension: upper { + type: number + hidden: no + sql: ${TABLE}.prediction_interval_upper_bound;; + } + dimension: lower { + type: number + hidden: no + sql:${TABLE}.prediction_interval_lower_bound ;; + } + measure: forecast_value + { + type:sum_distinct + sql_distinct_key: ${events_event_name};; + sql:${forecast_value_num};; + } + measure: standard_error + { + type: sum_distinct + sql_distinct_key: ${events_event_name};; + sql:${se};; + } + measure: prediction_interval_lower_bound { + type:sum_distinct + sql_distinct_key: ${events_event_name};; + sql:${lower};; + } + measure: prediction_interval_upper_bound { + type:sum_distinct + sql_distinct_key: ${events_event_name};; + sql: ${upper};; + } +} diff --git a/views/bqml/arima_event_model/model_arima.view.lkml b/views/bqml/arima_event_model/model_arima.view.lkml new file mode 100644 index 0000000..2503780 --- /dev/null +++ b/views/bqml/arima_event_model/model_arima.view.lkml @@ -0,0 +1,55 @@ +include: "/views/*.view.lkml" +include: "/views/bqml/*/*.view.lkml" +view: model_arima { + #extension: required + derived_table: { + sql_trigger_value: ${training_input_arima.SQL_TABLE_NAME};; + sql_create: CREATE OR REPLACE MODEL ${SQL_TABLE_NAME} + OPTIONS( + MODEL_TYPE='ARIMA_PLUS', + time_series_timestamp_col='sessions_session_date', + time_series_data_col='sum_of_session_event_count', + time_series_id_col='events_event_name', + auto_arima=true) AS + SELECT * + FROM ${training_input_arima.SQL_TABLE_NAME};; + } + dimension: ts { + type: string + hidden: yes + } + dimension: ev_count { + type: number + hidden: yes + } + dimension: events_event_name { + type: string + hidden: yes + } + + } + #explore: train_data_arima {fields:[ts,ev_count]} + explore: model_evaluation {hidden:yes} + # + explore: optimal_model_coeff {hidden:yes} + #explore: forecasting {} + view: optimal_model_coeff{ + derived_table: { + sql: SELECT * FROM ML.ARIMA_COEFFICIENTS(MODEL ${model_arima.SQL_TABLE_NAME});; + } + dimension: ar_coefficients {type:number sql:${TABLE}.ar_coefficients;;} + dimension: ma_coefficients {type:number sql:${TABLE}.ma_coefficients;;} + dimension: intercept_or_drift {type:number sql:${TABLE}.intercept_or_drift;;} + } + view: model_evaluation { + derived_table: { + sql: SELECT * FROM ML.ARIMA_EVALUATE(MODEL ${model_arima.SQL_TABLE_NAME});; + } + dimension: events_event_name {type:string sql:${TABLE}.events_event_name ;;} + dimension: has_drift {type:string sql:${TABLE}.has_drift ;;} + dimension: non_seasonal_p {type:number sql:${TABLE}.non_seasonal_p ;; } + dimension: non_seasonal_q {type:number sql:${TABLE}.non_seasonal_q ;; } + dimension: non_seasonal_d {type:number sql:${TABLE}.non_seasonal_d ;; } + dimension: log_likelihood {type:number sql:${TABLE}.log_likelihood ;; } + dimension: AIC{type:number sql:${TABLE}.AIC ;; } + } diff --git a/views/bqml/arima_event_model/training_input_arima.view.lkml b/views/bqml/arima_event_model/training_input_arima.view.lkml new file mode 100644 index 0000000..104e532 --- /dev/null +++ b/views/bqml/arima_event_model/training_input_arima.view.lkml @@ -0,0 +1,18 @@ +view: training_input_arima { + derived_table: { + sql_trigger_value: ${incremental_prediction.SQL_TABLE_NAME} ;; + sql:SELECT + (DATE(TIMESTAMP_MICROS(events.event_timestamp) )) AS sessions_session_date, + events.event_name AS events_event_name, + COUNT(DISTINCT sessions.sl_key ) AS sum_of_session_event_count +FROM ${sessions.SQL_TABLE_NAME} AS sessions +LEFT JOIN UNNEST(sessions.event_data) as events with offset as event_row +WHERE ((( TIMESTAMP_MICROS(events.event_timestamp) ) >= ((TIMESTAMP_ADD(TIMESTAMP_TRUNC(CURRENT_TIMESTAMP(), DAY), INTERVAL -89 DAY))) AND ( TIMESTAMP_MICROS(events.event_timestamp) ) < ((TIMESTAMP_ADD(TIMESTAMP_ADD(TIMESTAMP_TRUNC(CURRENT_TIMESTAMP(), DAY), INTERVAL -89 DAY), INTERVAL 90 DAY))))) +GROUP BY 1,2 ORDER BY 1 DESC;; + } + dimension: session_date_arima { + hidden: yes + type: date + sql: ${TABLE}.sessions_session_date ;; + } + } diff --git a/views/bqml/avbb/training_data_avbb.view.lkml b/views/bqml/avbb/training_data_avbb.view.lkml new file mode 100644 index 0000000..3788e28 --- /dev/null +++ b/views/bqml/avbb/training_data_avbb.view.lkml @@ -0,0 +1,127 @@ +include: "/views/sessions/*.view.lkml" +include: "/views/*/*.view.lkml" +view: training_data_avbb { + derived_table: { + sql_trigger_value: ${forecasting.SQL_TABLE_NAME} ;; + sql:SELECT sessions.sl_key, + session_attribution.source, + session_attribution.medium, + session_attribution.campaign, + device_data.device__category as device, + events.event_name AS events_event_name, + device_data.device__is_limited_ad_tracking as lim_ad_track, + SUM(TIMESTAMP_DIFF(session_data.session_end,session_data.session_start,second)/86400.0) as session_duration, + SUM(session_data.session_page_view_count) as session_count, + COALESCE(SUM(event_data[SAFE_OFFSET(0)].user_ltv.revenue),0.0) as label + FROM ${sessions.SQL_TABLE_NAME} as sessions + LEFT JOIN UNNEST(sessions.event_data) as events with offset as event_row GROUP BY 1,2,3,4,5,6,7 ;; + } + dimension: sl_key { + hidden: yes + type: string + sql: ${TABLE}.sl_key ;; + } +} + + +view: avbb_model { + derived_table: { + sql_trigger_value: ${training_data_avbb.SQL_TABLE_NAME} ;; + sql_create: CREATE OR REPLACE MODEL ${SQL_TABLE_NAME} +OPTIONS + ( MODEL_TYPE='LINEAR_REG', + CALCULATE_P_VALUES=TRUE, + MAX_ITERATIONS=5, + CATEGORY_ENCODING_METHOD='DUMMY_ENCODING', + ENABLE_GLOBAL_EXPLAIN=TRUE, + DATA_SPLIT_METHOD='AUTO_SPLIT') AS + SELECT source, + medium, + campaign, + device, + events_event_name, + LN(session_duration) as session_duration, + session_count, + lim_ad_track, + LN(label) as label from ${training_data_avbb.SQL_TABLE_NAME} WHERE label>0 AND session_duration>0 + ;; + } +} + +view: model_explanation { + derived_table: { + sql_trigger_value: ${training_data_avbb.SQL_TABLE_NAME} ;; + sql: SELECT * FROM + ML.GLOBAL_EXPLAIN(MODEL ${avbb_model.SQL_TABLE_NAME}) ;; + } + dimension: feature { + type: string + sql: ${TABLE}.feature ;; + } + dimension: attribution { + type: number + sql: ${TABLE}.attribution ;; + } +} + +explore: model_explanation { + hidden: yes +} + +view: category_attribution { + derived_table: { + + sql_trigger_value: ${model_explanation.SQL_TABLE_NAME} ;; + sql: SELECT * FROM ML.ADVANCED_WEIGHTS( + MODEL ${avbb_model.SQL_TABLE_NAME}, + STRUCT(TRUE AS standardize)) + WHERE p_value<0.05 ;; + } + + dimension: processed_input { + type: string + sql: ${TABLE}.processed_input;; + } + dimension: category { + type: string + sql: ${TABLE}.category ;; + } + dimension: weight { + type: number + sql: ${TABLE}.weight ;; + } + dimension: standard_error { + type: number + sql: ${TABLE}.standard_error ;; + } + dimension: p_value { + type: number + sql: ${TABLE}.p_value ;; + } + +} +explore: category_attribution { + hidden: yes +} + +view: evaluation { + derived_table: { + sql_trigger_value: ${category_attribution.SQL_TABLE_NAME} ;; + sql: SELECT * FROM ML.EVALUATE(MODEL ${avbb_model.SQL_TABLE_NAME});; + } + dimension: MAE { + type: number + sql: ${TABLE}.mean_absolute_error ;; + } + dimension: MSLE { + type: number + sql: ${TABLE}.mean_squared_log_error ;; + } + dimension: r_squared { + type: number + sql: ${TABLE}.r2_score ;; + } +} +explore: evaluation { + hidden: yes +} diff --git a/views/bqml/purchase_propensity/future_input.view.lkml b/views/bqml/purchase_propensity/future_input.view.lkml new file mode 100644 index 0000000..0653a66 --- /dev/null +++ b/views/bqml/purchase_propensity/future_input.view.lkml @@ -0,0 +1,217 @@ +include: "/views/sessions/*.view.lkml" +view: future_input { + derived_table: { + sql_trigger_value: ${testing_input.SQL_TABLE_NAME} ;; + # partition_keys: ["session_date"] + #cluster_keys: ["session_date"] + sql: + select * from + (WITH + visitors_labeled AS ( + SELECT + user_pseudo_id, + MIN( + CASE + WHEN REGEXP_CONTAINS(event_name, 'purchase') + THEN event_timestamp END) AS event_session, + MIN( + CASE + WHEN REGEXP_CONTAINS(event_name, 'purchase') + THEN event_date END) AS event_date, + MAX( + CASE + WHEN REGEXP_CONTAINS(event_name, 'purchase') + THEN 1 + ELSE 0 END) AS label + FROM + ${session_list_with_event_history.SQL_TABLE_NAME} AS GA + WHERE + DATE(session_date) > DATE_SUB(CURRENT_DATE(), INTERVAL @{GA4_BQML_future_synth_months} MONTH) + GROUP BY + user_pseudo_id + ), + visitor_location AS ( + SELECT + GA.user_pseudo_id, + MAX(geo.city) AS city, + MAX(geo.region) AS region, + MAX(geo.country) AS country + FROM + ${session_list_with_event_history.SQL_TABLE_NAME} AS GA + LEFT JOIN visitors_labeled AS Labels + ON GA.user_pseudo_id = Labels.user_pseudo_id + WHERE + DATE(session_date) > DATE_SUB(CURRENT_DATE(), INTERVAL @{GA4_BQML_future_synth_months} MONTH) + AND ( + GA.event_timestamp < IFNULL(event_session, 0) + OR event_session IS NULL) + GROUP BY + user_pseudo_id + ), + visitor_day_page_map AS ( + SELECT + GA.user_pseudo_id, + EXTRACT(DAYOFWEEK FROM PARSE_DATE('%Y%m%d', GA.event_date)) AS day, + SUM( + CASE + WHEN event_name = 'page_view' + THEN 1 + ELSE 0 + END) + AS pages_viewed + FROM + ${session_list_with_event_history.SQL_TABLE_NAME} AS GA + LEFT JOIN visitors_labeled AS Labels + ON GA.user_pseudo_id = Labels.user_pseudo_id + WHERE + DATE(session_date) > DATE_SUB(CURRENT_DATE(), INTERVAL @{GA4_BQML_future_synth_months} MONTH) + AND ( + GA.event_timestamp < IFNULL(event_session, 0) + OR event_session IS NULL) + GROUP BY + 1, 2 + ), + visitor_common_day AS ( + SELECT + user_pseudo_id, + /* In the event of a tie, pick any of the top dates. */ + CASE + WHEN ANY_VALUE(day) = 1 THEN 'Sunday' + WHEN ANY_VALUE(day) = 2 THEN 'Monday' + WHEN ANY_VALUE(day) = 3 THEN 'Tuesday' + WHEN ANY_VALUE(day) = 4 THEN 'Wednesday' + WHEN ANY_VALUE(day) = 5 THEN 'Thursday' + WHEN ANY_VALUE(day) = 6 THEN 'Friday' + WHEN ANY_VALUE(day) = 7 THEN 'Saturday' + END AS day + FROM + visitor_day_page_map AS day_page_map + WHERE day_page_map.pages_viewed = ( + SELECT MAX(pages_viewed) + FROM visitor_day_page_map AS day_map + WHERE day_page_map.user_pseudo_id = day_map.user_pseudo_id) + GROUP BY 1 + ), + event_cnts AS ( + SELECT + GA.user_pseudo_id, + SUM(IF(event_name = 'user_engagement', 1, 0)) AS cnt_user_engagement, + SUM(IF(event_name = 'scroll', 1, 0)) AS cnt_scroll, + SUM(IF(event_name = 'session_start', 1, 0)) AS cnt_session_start + -- Uncomment, customize, and copy the line below to count specific events. + -- SUM(IF(event_name = 'my custom event', 1, 0)) AS cnt_my_custom_event + -- Don't forget to add a comma after 'cnt_session_start' when adding a new field. + FROM + ${session_list_with_event_history.SQL_TABLE_NAME} AS GA + LEFT JOIN visitors_labeled AS Labels + ON GA.user_pseudo_id = Labels.user_pseudo_id + WHERE + DATE(session_date) > DATE_SUB(CURRENT_DATE(), INTERVAL @{GA4_BQML_future_synth_months} MONTH) + AND ( + GA.event_timestamp < IFNULL(event_session, 0) + OR event_session IS NULL) + GROUP BY 1 + ), + engagement AS ( + SELECT + user_pseudo_id, + SAFE_DIVIDE( + SUM(session_engaged), + COUNT(DISTINCT session_id) + ) AS engagement_rate, + ROUND(SUM(engagement_time_msec)/1000) AS engagement_time_seconds, + COUNT(DISTINCT session_id) AS total_sessions + FROM ( + SELECT + GA.user_pseudo_id, + ( + SELECT value.int_value + FROM UNNEST(event_params) + WHERE key = 'ga_session_id' + ) AS session_id, + MAX(( + SELECT value.int_value + FROM UNNEST(event_params) + WHERE key = 'session_engaged' + )) AS session_engaged, + MAX(( + SELECT value.int_value + FROM UNNEST(event_params) + WHERE key = 'engagement_time_msec' + )) AS engagement_time_msec + FROM + ${session_list_with_event_history.SQL_TABLE_NAME} AS GA + LEFT JOIN visitors_labeled AS Labels + ON GA.user_pseudo_id = Labels.user_pseudo_id + WHERE + DATE(session_date) > DATE_SUB(CURRENT_DATE(), INTERVAL @{GA4_BQML_future_synth_months} MONTH) + AND ( + GA.event_timestamp < IFNULL(event_session, 0) + OR event_session IS NULL) + GROUP BY + user_pseudo_id, + session_id + ) + GROUP BY user_pseudo_id + ), + user_model AS ( + SELECT + GA.user_pseudo_id, + IFNULL(MAX(label), 0) AS will_purchase_in_future, + MAX(Visitor_location.country) AS visited_country, + MAX(Visitor_location.region) AS visited_region, + MAX(Visitor_location.city) AS visited_city, + MAX(Visitor_common_day.day) AS visited_dow, + SUM( + CASE + WHEN event_name = 'page_view' + THEN 1 + ELSE 0 END) AS pageviews, + MAX(device.operating_system) AS device_operating_system, + MAX(device.operating_system_version) AS device_operating_system_version, + MAX(device.category) AS device_category, + MAX(device.web_info.browser) AS browser, + MAX(traffic_source.medium) AS medium, + MAX(traffic_source.source) AS source, + COUNT(DISTINCT event_name) AS events, + MAX(event_name) AS common_events, + MAX(device.mobile_brand_name) AS device_mobile_brand_name, + MAX(device.mobile_model_name) AS device_mobile_model_name, + MAX(device.language) AS device_language, + COUNT(DISTINCT EXTRACT(DAYOFWEEK FROM PARSE_DATE('%Y%m%d', GA.event_date))) + AS num_diff_days_visited, + IFNULL(MAX(Engagement.engagement_rate), 0) AS engagement_rate, + IFNULL(MAX(Engagement.engagement_time_seconds), 0) AS engagement_time_seconds, + IFNULL(MAX(Event_counts.cnt_user_engagement), 0) AS cnt_user_engagement, + IFNULL(MAX(Event_counts.cnt_scroll), 0) AS cnt_scroll, + IFNULL(MAX(Event_counts.cnt_session_start), 0) AS cnt_session_start + -- Uncomment the field below to add your additional feature to the model. + -- IFNULL(MAX(Event_counts.cnt_my_custom_event), 0) AS cnt_my_custom_event + -- Don't forget to add a comma after 'cnt_session_start' when adding a new field. + FROM + ${session_list_with_event_history.SQL_TABLE_NAME} AS GA + LEFT JOIN visitors_labeled AS Labels + ON GA.user_pseudo_id = Labels.user_pseudo_id + LEFT JOIN engagement AS Engagement + ON GA.user_pseudo_id = Engagement.user_pseudo_id + LEFT JOIN visitor_location AS Visitor_location + ON GA.user_pseudo_id = Visitor_location.user_pseudo_id + LEFT JOIN visitor_common_day AS Visitor_common_day + ON GA.user_pseudo_id = Visitor_common_day.user_pseudo_id + LEFT JOIN event_cnts AS Event_counts + ON GA.user_pseudo_id = Event_counts.user_pseudo_id + WHERE + DATE(session_date) > DATE_SUB(CURRENT_DATE(), INTERVAL @{GA4_BQML_future_synth_months} MONTH) + AND ( + GA.event_timestamp < IFNULL(event_session, 0) + OR event_session IS NULL) + AND platform IN ('WEB') + GROUP BY + GA.user_pseudo_id + ) + SELECT + * EXCEPT(will_purchase_in_future) + FROM + user_model);; + } +} diff --git a/views/bqml/purchase_propensity/incremental_prediction.view.lkml b/views/bqml/purchase_propensity/incremental_prediction.view.lkml new file mode 100644 index 0000000..5ebf769 --- /dev/null +++ b/views/bqml/purchase_propensity/incremental_prediction.view.lkml @@ -0,0 +1,95 @@ +include: "/explores/sessions.explore.lkml" +include: "/views/*/*.view.lkml" +include: "/views/bqml/*/*.view.lkml" +include: "/views/*.view.lkml" + +explore: pred_history {} +view: pred_history { + derived_table: { + explore_source: sessions { + column: pred_probability_bucket { field: future_purchase_prediction.pred_probability_bucket } + column: total_purchase_revenue_usd { field: events.total_purchase_revenue_usd } + column: count { field: future_purchase_prediction.count } + derived_column: week { + sql:DATE_TRUNC(current_date(), week);; + } + filters: { + field: future_purchase_prediction.user_pseudo_id + value: "NOT NULL" + } + filters: { + field: sessions.session_date + value: "90 days" + } + } + } + dimension: pred_probability_bucket { + label: "Propensity to Purchase Pred Probability Bucket" + description: "" + } + dimension: total_purchase_revenue_usd { + label: "Events Purchase Revenue (USD)" + description: "" + value_format: "$#,##0.00" + type: number + } + dimension: count { + label: "Propensity to Purchase Person Count" + description: "" + type: number + } + dimension: week { + # label: "Week of PDT creation" + description: "Week of PDT creation" + type: date + # sql: concat("Week",cast(EXTRACT(WEEK FROM current_date()) as string)) ;; + } + # dimension: week_num { + # # label: "Week of PDT creation" + # description: "Week num of PDT creation" + # type: number + # sql: EXTRACT(WEEK FROM current_date()) ;; + # } +} + +explore: incremental_prediction {hidden:yes} +view: incremental_prediction { + derived_table: { + #datagroup_trigger: bqml_datagroup + sql_trigger_value: ${future_purchase_model.SQL_TABLE_NAME} ;; + create_process: { + sql_step: + CREATE TABLE IF NOT EXISTS ${SQL_TABLE_NAME} ( + pred_probability_bucket STRING, + total_purchase_revenue_usd FLOAT64, + count INT64, + week DATE + );; + sql_step: + Insert into ${SQL_TABLE_NAME} + SELECT + pred_probability_bucket,total_purchase_revenue_usd,count, week + FROM ${pred_history.SQL_TABLE_NAME} + where week not in (select distinct week from ${SQL_TABLE_NAME});; + } + } + dimension: week { + description: "Week of PDT creation" + # type: date + } + dimension: pred_probability_bucket { + label: "Pred History Propensity to Purchase Pred Probability Bucket" + description: "Pred History Propensity to Purchase Pred Probability Bucket" + } + measure: total_purchase_revenue_usd { + label: "Pred History Events Purchase Revenue (USD)" + description: "Pred History Events Purchase Revenue (USD)" + value_format: "$#,##0.00" + type: sum + } + measure: count { + label: "Pred History Propensity to Purchase Person Count" + description: "Pred History Propensity to Purchase Person Count" + type: sum + } +} diff --git a/views/bqml/purchase_propensity/predictions.view.lkml b/views/bqml/purchase_propensity/predictions.view.lkml new file mode 100644 index 0000000..05af958 --- /dev/null +++ b/views/bqml/purchase_propensity/predictions.view.lkml @@ -0,0 +1,247 @@ +######################## TRAINING/TESTING INPUTS ############################# +include: "/views/bqml/purchase_propensity/*.view" +include: "/views/sessions/*.view" + +######################## MODEL ############################# + +view: future_purchase_model { + derived_table: { + sql_trigger_value: ${future_input.SQL_TABLE_NAME} ;; + sql_create: + CREATE OR REPLACE MODEL ${SQL_TABLE_NAME} + OPTIONS( + MODEL_TYPE = 'BOOSTED_TREE_CLASSIFIER', + BOOSTER_TYPE = 'GBTREE', + MAX_ITERATIONS = 100, + --LEARN_RATE = 0.1, + COLSAMPLE_BYLEVEL = 0.85, + COLSAMPLE_BYTREE = 0.85, + COLSAMPLE_BYNODE = 0.85, + SUBSAMPLE = 0.85, + --NUM_PARALLEL_TREE = 10, + DATA_SPLIT_METHOD = 'AUTO_SPLIT', + EARLY_STOP = FALSE, + ENABLE_GLOBAL_EXPLAIN = TRUE, + APPROX_GLOBAL_FEATURE_CONTRIB = TRUE, + INPUT_LABEL_COLS = ['will_purchase_in_future'] + ) AS + SELECT + * EXCEPT(user_pseudo_id) + FROM ${training_input.SQL_TABLE_NAME};; + } +} + +######################## TRAINING INFORMATION ############################# +explore: future_purchase_model_evaluation {hidden:yes} +explore: future_purchase_model_training_info {hidden:yes} +explore: roc_curve {hidden:yes} +explore: confusion_matrix {hidden:yes} +explore: feature_importance {hidden:yes} + +# VIEWS: +view: future_purchase_model_evaluation { + derived_table: { + sql_trigger_value: ${future_purchase_model.SQL_TABLE_NAME} ;; + sql: SELECT * FROM ml.EVALUATE( + MODEL ${future_purchase_model.SQL_TABLE_NAME}, + (SELECT * FROM ${testing_input.SQL_TABLE_NAME}));; + } + dimension: recall {type: number value_format_name:percent_2} + dimension: accuracy {type: number value_format_name:percent_2} + dimension: f1_score {type: number value_format_name:percent_3} + dimension: log_loss {type: number} + dimension: roc_auc {type: number} +} + +view: roc_curve { + derived_table: { + sql_trigger_value: ${future_purchase_model.SQL_TABLE_NAME} ;; + sql: SELECT * FROM ml.ROC_CURVE( + MODEL ${future_purchase_model.SQL_TABLE_NAME}, + (SELECT * FROM ${testing_input.SQL_TABLE_NAME}));; + } + dimension: threshold { + type: number + link: { + label: "Likely Customers to Purchase" + url: "/explore/bqml_ga_demo/ga_sessions?fields=ga_sessions.fullVisitorId,future_purchase_prediction.max_predicted_score&f[future_purchase_prediction.predicted_will_purchase_in_future]=%3E%3D{{value}}" + icon_url: "http://www.looker.com/favicon.ico" + } + } + dimension: recall {type: number value_format_name: percent_2} + dimension: false_positive_rate {type: number} + dimension: true_positives {type: number } + dimension: false_positives {type: number} + dimension: true_negatives {type: number} + dimension: false_negatives {type: number } + dimension: precision { + type: number + value_format_name: percent_2 + sql: ${true_positives} / NULLIF((${true_positives} + ${false_positives}),0);; + } + measure: total_false_positives { + type: sum + sql: ${false_positives} ;; + } + measure: total_true_positives { + type: sum + sql: ${true_positives} ;; + } + dimension: threshold_accuracy { + type: number + value_format_name: percent_2 + sql: 1.0*(${true_positives} + ${true_negatives}) / NULLIF((${true_positives} + ${true_negatives} + ${false_positives} + ${false_negatives}),0);; + } + dimension: threshold_f1 { + type: number + value_format_name: percent_3 + sql: 2.0*${recall}*${precision} / NULLIF((${recall}+${precision}),0);; + } +} + +view: confusion_matrix { + derived_table: { + sql_trigger_value: ${future_purchase_model.SQL_TABLE_NAME} ;; + sql: SELECT Expected_label,_0 as Predicted_0,_1 as Predicted_1 FROM ml.confusion_matrix( + MODEL ${future_purchase_model.SQL_TABLE_NAME}, + (SELECT * FROM ${testing_input.SQL_TABLE_NAME}));; + } + dimension: Expected_label {type:string} + dimension: Predicted_0 {type: number} + dimension: Predicted_1 {type: number} +} + +view: future_purchase_model_training_info { + derived_table: { + sql_trigger_value: ${future_purchase_model.SQL_TABLE_NAME} ;; + sql: SELECT * FROM ml.TRAINING_INFO(MODEL ${future_purchase_model.SQL_TABLE_NAME});; + } + dimension: training_run {type: number} + dimension: iteration {type: number} + dimension: loss_raw {sql: ${TABLE}.loss;; type: number hidden:yes} + dimension: eval_loss {type: number} + dimension: duration_ms {label:"Duration (ms)" type: number} + dimension: learning_rate {type: number} + measure: total_iterations { + type: count + } + measure: loss { + value_format_name: decimal_2 + type: sum + sql: ${loss_raw} ;; + } + measure: total_training_time { + type: sum + label:"Total Training Time (sec)" + sql: ${duration_ms}/1000 ;; + value_format_name: decimal_1 + } + measure: average_iteration_time { + type: average + label:"Average Iteration Time (sec)" + sql: ${duration_ms}/1000 ;; + value_format_name: decimal_1 + } +} + +view: feature_importance { + derived_table: { + sql_trigger_value: ${future_purchase_model.SQL_TABLE_NAME} ;; + sql: SELECT + * + FROM + ML.GLOBAL_EXPLAIN(MODEL ${future_purchase_model.SQL_TABLE_NAME});; + } + dimension: feature {type:string} + dimension: attribution {type: number value_format_name: decimal_2} +} + +########################################## PREDICT FUTURE ############################ +explore: future_purchase_prediction {hidden:yes} +view: future_purchase_prediction { + derived_table: { + sql_trigger_value: ${future_purchase_model.SQL_TABLE_NAME} ;; + sql: select + pred.*, + predicted_will_purchase_in_future_probs_unnest.prob as pred_probability from + (SELECT * FROM ml.PREDICT( + MODEL ${future_purchase_model.SQL_TABLE_NAME}, + (SELECT * FROM ${future_input.SQL_TABLE_NAME}))) pred + left join unnest(pred.predicted_will_purchase_in_future_probs) as predicted_will_purchase_in_future_probs_unnest + where predicted_will_purchase_in_future_probs_unnest.label=1 + ;; + } + dimension: predicted_will_purchase_in_future {type: number} + # dimension: sl_key {type: number hidden:yes} + # dimension: user_pseudo_id {type: number hidden: yes} + dimension: user_pseudo_id {type: number primary_key: yes} + # dimension: prob {type: number hidden: yes} + + dimension: pred_probability { + type: number + value_format_name: percent_2 + sql: ${TABLE}.pred_probability ;; + drill_fields: [user_pseudo_id] + } + dimension: pred_prob_perc { + type: number + sql:APPROX_QUANTILES(${TABLE}.pred_probability,100);; + } + dimension: pred_prob_perc_10 { + type: number + hidden: yes + sql: ${pred_prob_perc}[OFFSET(10)] ;; + } + dimension: pred_prob_perc_20 { + type: number + hidden: yes + sql: ${pred_prob_perc}[OFFSET(20)] ;; + } + dimension: pred_prob_perc_30 { + type: number + hidden: yes + sql: ${pred_prob_perc}[OFFSET(30)];; + } + dimension: pred_prob_perc_40 { + type: number + hidden: yes + sql:${pred_prob_perc}[OFFSET(40)];; + } + dimension: pred_prob_perc_50 { + type: number + hidden: yes + sql: ${pred_prob_perc}[OFFSET(50)] ;; + } + dimension: pred_prob_perc_60 { + type: number + hidden: yes + sql:${pred_prob_perc}[OFFSET(60)] ;; + } + dimension: pred_prob_perc_70 { + type: number + hidden: yes + sql: ${pred_prob_perc}[OFFSET(70)] ;; + } + dimension: pred_prob_perc_80 { + type: number + hidden: yes + sql: ${pred_prob_perc}[OFFSET(80)];; + } + dimension: pred_prob_perc_90 { + type: number + hidden: yes + sql: ${pred_prob_perc}[OFFSET(90)] ;; + } + + dimension: pred_probability_bucket { + type: tier + tiers: [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9] + style: relational + sql: ${pred_probability} ;; + drill_fields: [user_pseudo_id] + } + measure: count { + label:"Person Count" + type: count + } +} diff --git a/views/bqml/purchase_propensity/testing_input.view.lkml b/views/bqml/purchase_propensity/testing_input.view.lkml new file mode 100644 index 0000000..f96d87b --- /dev/null +++ b/views/bqml/purchase_propensity/testing_input.view.lkml @@ -0,0 +1,215 @@ +include: "/views/sessions/*.view.lkml" +view: testing_input { + derived_table: { + sql_trigger_value: ${training_input.SQL_TABLE_NAME} ;; + sql: + select * from + (WITH + visitors_labeled AS ( + SELECT + user_pseudo_id, + MIN( + CASE + WHEN REGEXP_CONTAINS(event_name, 'purchase') + THEN event_timestamp END) AS event_session, + MIN( + CASE + WHEN REGEXP_CONTAINS(event_name, 'purchase') + THEN event_date END) AS event_date, + MAX( + CASE + WHEN REGEXP_CONTAINS(event_name, 'purchase') + THEN 1 + ELSE 0 END) AS label + FROM + ${session_list_with_event_history.SQL_TABLE_NAME} AS GA + WHERE + DATE(session_date) > DATE_SUB(CURRENT_DATE(), INTERVAL @{GA4_BQML_test_months} MONTH) + GROUP BY + user_pseudo_id + ), + visitor_location AS ( + SELECT + GA.user_pseudo_id, + MAX(geo.city) AS city, + MAX(geo.region) AS region, + MAX(geo.country) AS country + FROM + ${session_list_with_event_history.SQL_TABLE_NAME} AS GA + LEFT JOIN visitors_labeled AS Labels + ON GA.user_pseudo_id = Labels.user_pseudo_id + WHERE + DATE(session_date) > DATE_SUB(CURRENT_DATE(), INTERVAL @{GA4_BQML_test_months} MONTH) + AND ( + GA.event_timestamp < IFNULL(event_session, 0) + OR event_session IS NULL) + GROUP BY + user_pseudo_id + ), + visitor_day_page_map AS ( + SELECT + GA.user_pseudo_id, + EXTRACT(DAYOFWEEK FROM PARSE_DATE('%Y%m%d', GA.event_date)) AS day, + SUM( + CASE + WHEN event_name = 'page_view' + THEN 1 + ELSE 0 + END) + AS pages_viewed + FROM + ${session_list_with_event_history.SQL_TABLE_NAME} AS GA + LEFT JOIN visitors_labeled AS Labels + ON GA.user_pseudo_id = Labels.user_pseudo_id + WHERE + DATE(session_date) > DATE_SUB(CURRENT_DATE(), INTERVAL @{GA4_BQML_test_months} MONTH) + AND ( + GA.event_timestamp < IFNULL(event_session, 0) + OR event_session IS NULL) + GROUP BY + 1, 2 + ), + visitor_common_day AS ( + SELECT + user_pseudo_id, + /* In the event of a tie, pick any of the top dates. */ + CASE + WHEN ANY_VALUE(day) = 1 THEN 'Sunday' + WHEN ANY_VALUE(day) = 2 THEN 'Monday' + WHEN ANY_VALUE(day) = 3 THEN 'Tuesday' + WHEN ANY_VALUE(day) = 4 THEN 'Wednesday' + WHEN ANY_VALUE(day) = 5 THEN 'Thursday' + WHEN ANY_VALUE(day) = 6 THEN 'Friday' + WHEN ANY_VALUE(day) = 7 THEN 'Saturday' + END AS day + FROM + visitor_day_page_map AS day_page_map + WHERE day_page_map.pages_viewed = ( + SELECT MAX(pages_viewed) + FROM visitor_day_page_map AS day_map + WHERE day_page_map.user_pseudo_id = day_map.user_pseudo_id) + GROUP BY 1 + ), + event_cnts AS ( + SELECT + GA.user_pseudo_id, + SUM(IF(event_name = 'user_engagement', 1, 0)) AS cnt_user_engagement, + SUM(IF(event_name = 'scroll', 1, 0)) AS cnt_scroll, + SUM(IF(event_name = 'session_start', 1, 0)) AS cnt_session_start + -- Uncomment, customize, and copy the line below to count specific events. + -- SUM(IF(event_name = 'my custom event', 1, 0)) AS cnt_my_custom_event + -- Don't forget to add a comma after 'cnt_session_start' when adding a new field. + FROM + ${session_list_with_event_history.SQL_TABLE_NAME} AS GA + LEFT JOIN visitors_labeled AS Labels + ON GA.user_pseudo_id = Labels.user_pseudo_id + WHERE + DATE(session_date) > DATE_SUB(CURRENT_DATE(), INTERVAL @{GA4_BQML_test_months} MONTH) + AND ( + GA.event_timestamp < IFNULL(event_session, 0) + OR event_session IS NULL) + GROUP BY 1 + ), + engagement AS ( + SELECT + user_pseudo_id, + SAFE_DIVIDE( + SUM(session_engaged), + COUNT(DISTINCT session_id) + ) AS engagement_rate, + ROUND(SUM(engagement_time_msec)/1000) AS engagement_time_seconds, + COUNT(DISTINCT session_id) AS total_sessions + FROM ( + SELECT + GA.user_pseudo_id, + ( + SELECT value.int_value + FROM UNNEST(event_params) + WHERE key = 'ga_session_id' + ) AS session_id, + MAX(( + SELECT value.int_value + FROM UNNEST(event_params) + WHERE key = 'session_engaged' + )) AS session_engaged, + MAX(( + SELECT value.int_value + FROM UNNEST(event_params) + WHERE key = 'engagement_time_msec' + )) AS engagement_time_msec + FROM + ${session_list_with_event_history.SQL_TABLE_NAME} AS GA + LEFT JOIN visitors_labeled AS Labels + ON GA.user_pseudo_id = Labels.user_pseudo_id + WHERE + DATE(session_date) > DATE_SUB(CURRENT_DATE(), INTERVAL @{GA4_BQML_test_months} MONTH) + AND ( + GA.event_timestamp < IFNULL(event_session, 0) + OR event_session IS NULL) + GROUP BY + user_pseudo_id, + session_id + ) + GROUP BY user_pseudo_id + ), + user_model AS ( + SELECT + GA.user_pseudo_id, + IFNULL(MAX(label), 0) AS will_purchase_in_future, + MAX(Visitor_location.country) AS visited_country, + MAX(Visitor_location.region) AS visited_region, + MAX(Visitor_location.city) AS visited_city, + MAX(Visitor_common_day.day) AS visited_dow, + SUM( + CASE + WHEN event_name = 'page_view' + THEN 1 + ELSE 0 END) AS pageviews, + MAX(device.operating_system) AS device_operating_system, + MAX(device.operating_system_version) AS device_operating_system_version, + MAX(device.category) AS device_category, + MAX(device.web_info.browser) AS browser, + MAX(traffic_source.medium) AS medium, + MAX(traffic_source.source) AS source, + COUNT(DISTINCT event_name) AS events, + MAX(event_name) AS common_events, + MAX(device.mobile_brand_name) AS device_mobile_brand_name, + MAX(device.mobile_model_name) AS device_mobile_model_name, + MAX(device.language) AS device_language, + COUNT(DISTINCT EXTRACT(DAYOFWEEK FROM PARSE_DATE('%Y%m%d', GA.event_date))) + AS num_diff_days_visited, + IFNULL(MAX(Engagement.engagement_rate), 0) AS engagement_rate, + IFNULL(MAX(Engagement.engagement_time_seconds), 0) AS engagement_time_seconds, + IFNULL(MAX(Event_counts.cnt_user_engagement), 0) AS cnt_user_engagement, + IFNULL(MAX(Event_counts.cnt_scroll), 0) AS cnt_scroll, + IFNULL(MAX(Event_counts.cnt_session_start), 0) AS cnt_session_start + -- Uncomment the field below to add your additional feature to the model. + -- IFNULL(MAX(Event_counts.cnt_my_custom_event), 0) AS cnt_my_custom_event + -- Don't forget to add a comma after 'cnt_session_start' when adding a new field. + FROM + ${session_list_with_event_history.SQL_TABLE_NAME} AS GA + LEFT JOIN visitors_labeled AS Labels + ON GA.user_pseudo_id = Labels.user_pseudo_id + LEFT JOIN engagement AS Engagement + ON GA.user_pseudo_id = Engagement.user_pseudo_id + LEFT JOIN visitor_location AS Visitor_location + ON GA.user_pseudo_id = Visitor_location.user_pseudo_id + LEFT JOIN visitor_common_day AS Visitor_common_day + ON GA.user_pseudo_id = Visitor_common_day.user_pseudo_id + LEFT JOIN event_cnts AS Event_counts + ON GA.user_pseudo_id = Event_counts.user_pseudo_id + WHERE + DATE(session_date) > DATE_SUB(CURRENT_DATE(), INTERVAL @{GA4_BQML_test_months} MONTH) + AND ( + GA.event_timestamp < IFNULL(event_session, 0) + OR event_session IS NULL) + AND platform IN ('WEB') + GROUP BY + GA.user_pseudo_id + ) + SELECT + * + FROM + user_model);; + } +} diff --git a/views/bqml/purchase_propensity/training_input.view.lkml b/views/bqml/purchase_propensity/training_input.view.lkml new file mode 100644 index 0000000..f3fe331 --- /dev/null +++ b/views/bqml/purchase_propensity/training_input.view.lkml @@ -0,0 +1,216 @@ +include: "/views/sessions/*.view.lkml" +include: "/views/*/*.view.lkml" +view: training_input { + derived_table: { + #datagroup_trigger: bqml_datagroup + sql_trigger_value: ${sessions.SQL_TABLE_NAME} ;; + sql: + WITH + visitors_labeled AS ( + SELECT + user_pseudo_id, + MIN( + CASE + WHEN REGEXP_CONTAINS(event_name, 'purchase') + THEN event_timestamp END) AS event_session, + MIN( + CASE + WHEN REGEXP_CONTAINS(event_name, 'purchase') + THEN event_date END) AS event_date, + MAX( + CASE + WHEN REGEXP_CONTAINS(event_name, 'purchase') + THEN 1 + ELSE 0 END) AS label + FROM + ${session_list_with_event_history.SQL_TABLE_NAME} AS GA + WHERE + DATE(session_date) > DATE_SUB(CURRENT_DATE(), INTERVAL (@{GA4_BQML_train_months} + @{GA4_BQML_test_months}) MONTH) AND DATE(session_date) < DATE_SUB(CURRENT_DATE(), INTERVAL @{GA4_BQML_test_months} MONTH) + GROUP BY + user_pseudo_id + ), + visitor_location AS ( + SELECT + GA.user_pseudo_id, + MAX(geo.city) AS city, + MAX(geo.region) AS region, + MAX(geo.country) AS country + FROM + ${session_list_with_event_history.SQL_TABLE_NAME} AS GA + LEFT JOIN visitors_labeled AS Labels + ON GA.user_pseudo_id = Labels.user_pseudo_id + WHERE + DATE(session_date) > DATE_SUB(CURRENT_DATE(), INTERVAL (@{GA4_BQML_train_months} + @{GA4_BQML_test_months}) MONTH) AND DATE(session_date) < DATE_SUB(CURRENT_DATE(), INTERVAL @{GA4_BQML_test_months} MONTH) + AND ( + GA.event_timestamp < IFNULL(event_session, 0) + OR event_session IS NULL) + GROUP BY + user_pseudo_id + ), + visitor_day_page_map AS ( + SELECT + GA.user_pseudo_id, + EXTRACT(DAYOFWEEK FROM PARSE_DATE('%Y%m%d', GA.event_date)) AS day, + SUM( + CASE + WHEN event_name = 'page_view' + THEN 1 + ELSE 0 + END) + AS pages_viewed + FROM + ${session_list_with_event_history.SQL_TABLE_NAME} AS GA + LEFT JOIN visitors_labeled AS Labels + ON GA.user_pseudo_id = Labels.user_pseudo_id + WHERE + DATE(session_date) > DATE_SUB(CURRENT_DATE(), INTERVAL (@{GA4_BQML_train_months} + @{GA4_BQML_test_months}) MONTH) AND DATE(session_date) < DATE_SUB(CURRENT_DATE(), INTERVAL @{GA4_BQML_test_months} MONTH) + AND ( + GA.event_timestamp < IFNULL(event_session, 0) + OR event_session IS NULL) + GROUP BY + 1, 2 + ), + visitor_common_day AS ( + SELECT + user_pseudo_id, + /* In the event of a tie, pick any of the top dates. */ + CASE + WHEN ANY_VALUE(day) = 1 THEN 'Sunday' + WHEN ANY_VALUE(day) = 2 THEN 'Monday' + WHEN ANY_VALUE(day) = 3 THEN 'Tuesday' + WHEN ANY_VALUE(day) = 4 THEN 'Wednesday' + WHEN ANY_VALUE(day) = 5 THEN 'Thursday' + WHEN ANY_VALUE(day) = 6 THEN 'Friday' + WHEN ANY_VALUE(day) = 7 THEN 'Saturday' + END AS day + FROM + visitor_day_page_map AS day_page_map + WHERE day_page_map.pages_viewed = ( + SELECT MAX(pages_viewed) + FROM visitor_day_page_map AS day_map + WHERE day_page_map.user_pseudo_id = day_map.user_pseudo_id) + GROUP BY 1 + ), + event_cnts AS ( + SELECT + GA.user_pseudo_id, + SUM(IF(event_name = 'user_engagement', 1, 0)) AS cnt_user_engagement, + SUM(IF(event_name = 'scroll', 1, 0)) AS cnt_scroll, + SUM(IF(event_name = 'session_start', 1, 0)) AS cnt_session_start + -- Uncomment, customize, and copy the line below to count specific events. + -- SUM(IF(event_name = 'my custom event', 1, 0)) AS cnt_my_custom_event + -- Don't forget to add a comma after 'cnt_session_start' when adding a new field. + FROM + ${session_list_with_event_history.SQL_TABLE_NAME} AS GA + LEFT JOIN visitors_labeled AS Labels + ON GA.user_pseudo_id = Labels.user_pseudo_id + WHERE + DATE(session_date) > DATE_SUB(CURRENT_DATE(), INTERVAL (@{GA4_BQML_train_months} + @{GA4_BQML_test_months}) MONTH) AND DATE(session_date) < DATE_SUB(CURRENT_DATE(), INTERVAL @{GA4_BQML_test_months} MONTH) + AND ( + GA.event_timestamp < IFNULL(event_session, 0) + OR event_session IS NULL) + GROUP BY 1 + ), + engagement AS ( + SELECT + user_pseudo_id, + SAFE_DIVIDE( + SUM(session_engaged), + COUNT(DISTINCT session_id) + ) AS engagement_rate, + ROUND(SUM(engagement_time_msec)/1000) AS engagement_time_seconds, + COUNT(DISTINCT session_id) AS total_sessions + FROM ( + SELECT + GA.user_pseudo_id, + ( + SELECT value.int_value + FROM UNNEST(event_params) + WHERE key = 'ga_session_id' + ) AS session_id, + MAX(( + SELECT value.int_value + FROM UNNEST(event_params) + WHERE key = 'session_engaged' + )) AS session_engaged, + MAX(( + SELECT value.int_value + FROM UNNEST(event_params) + WHERE key = 'engagement_time_msec' + )) AS engagement_time_msec + FROM + ${session_list_with_event_history.SQL_TABLE_NAME} AS GA + LEFT JOIN visitors_labeled AS Labels + ON GA.user_pseudo_id = Labels.user_pseudo_id + WHERE + DATE(session_date) > DATE_SUB(CURRENT_DATE(), INTERVAL (@{GA4_BQML_train_months} + @{GA4_BQML_test_months}) MONTH) AND DATE(session_date) < DATE_SUB(CURRENT_DATE(), INTERVAL @{GA4_BQML_test_months} MONTH) + AND ( + GA.event_timestamp < IFNULL(event_session, 0) + OR event_session IS NULL) + GROUP BY + user_pseudo_id, + session_id + ) + GROUP BY user_pseudo_id + ), + user_model AS ( + SELECT + GA.user_pseudo_id, + IFNULL(MAX(label), 0) AS will_purchase_in_future, + MAX(Visitor_location.country) AS visited_country, + MAX(Visitor_location.region) AS visited_region, + MAX(Visitor_location.city) AS visited_city, + MAX(Visitor_common_day.day) AS visited_dow, + SUM( + CASE + WHEN event_name = 'page_view' + THEN 1 + ELSE 0 END) AS pageviews, + MAX(device.operating_system) AS device_operating_system, + MAX(device.operating_system_version) AS device_operating_system_version, + MAX(device.category) AS device_category, + MAX(device.web_info.browser) AS browser, + MAX(traffic_source.medium) AS medium, + MAX(traffic_source.source) AS source, + COUNT(DISTINCT event_name) AS events, + MAX(event_name) AS common_events, + MAX(device.mobile_brand_name) AS device_mobile_brand_name, + MAX(device.mobile_model_name) AS device_mobile_model_name, + MAX(device.language) AS device_language, + COUNT(DISTINCT EXTRACT(DAYOFWEEK FROM PARSE_DATE('%Y%m%d', GA.event_date))) + AS num_diff_days_visited, + IFNULL(MAX(Engagement.engagement_rate), 0) AS engagement_rate, + IFNULL(MAX(Engagement.engagement_time_seconds), 0) AS engagement_time_seconds, + IFNULL(MAX(Event_counts.cnt_user_engagement), 0) AS cnt_user_engagement, + IFNULL(MAX(Event_counts.cnt_scroll), 0) AS cnt_scroll, + IFNULL(MAX(Event_counts.cnt_session_start), 0) AS cnt_session_start + -- Uncomment the field below to add your additional feature to the model. + -- IFNULL(MAX(Event_counts.cnt_my_custom_event), 0) AS cnt_my_custom_event + -- Don't forget to add a comma after 'cnt_session_start' when adding a new field. + FROM + ${session_list_with_event_history.SQL_TABLE_NAME} AS GA + LEFT JOIN visitors_labeled AS Labels + ON GA.user_pseudo_id = Labels.user_pseudo_id + LEFT JOIN engagement AS Engagement + ON GA.user_pseudo_id = Engagement.user_pseudo_id + LEFT JOIN visitor_location AS Visitor_location + ON GA.user_pseudo_id = Visitor_location.user_pseudo_id + LEFT JOIN visitor_common_day AS Visitor_common_day + ON GA.user_pseudo_id = Visitor_common_day.user_pseudo_id + LEFT JOIN event_cnts AS Event_counts + ON GA.user_pseudo_id = Event_counts.user_pseudo_id + WHERE + DATE(session_date) > DATE_SUB(CURRENT_DATE(), INTERVAL (@{GA4_BQML_train_months} + @{GA4_BQML_test_months}) MONTH) AND DATE(session_date) < DATE_SUB(CURRENT_DATE(), INTERVAL @{GA4_BQML_test_months} MONTH) + AND ( + GA.event_timestamp < IFNULL(event_session, 0) + OR event_session IS NULL) + AND platform IN ('WEB') + GROUP BY + GA.user_pseudo_id + ) + SELECT + * + FROM + user_model;; + } +} diff --git a/views/event_data_dimensions/.gitkeep b/views/event_data_dimensions/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/views/event_data_dimensions/event_data_event_params.view.lkml b/views/event_data_dimensions/event_data_event_params.view.lkml new file mode 100644 index 0000000..47e187a --- /dev/null +++ b/views/event_data_dimensions/event_data_event_params.view.lkml @@ -0,0 +1,178 @@ +view: event_data_event_params { + extension: required + + ## Event Parameters + ## Because there are multiple "key"/"value" rows per event, these are unnested at the dimension level. + ## This view is included in event_data.view, and not directly joined on the model. + + dimension: event_param_all_data { + group_label: "Event: Parameters" + label: "All Data" + type: number + sql: (SELECT value.double_value FROM UNNEST(event_params) WHERE key = "all_data") ;; + } + + dimension: event_param_campaign { + group_label: "Event: Parameters" + label: "Campaign" + description: "The campaign value. Usually set by the utm_campaign URL parameter." + type: string + sql: (SELECT value.string_value FROM UNNEST(event_params) WHERE key = "campaign") ;; + full_suggestions: yes + } + + dimension: event_param_clean_event { + group_label: "Event: Parameters" + label: "Clean Event" + type: string + sql: (SELECT value.string_value FROM UNNEST(event_params) WHERE key = "clean_event") ;; + full_suggestions: yes + } + + dimension: event_param_debug_mode { + group_label: "Event: Parameters" + label: "Debug Mode" + type: number + sql: (SELECT value.int_value FROM UNNEST(event_params) WHERE key = "debug_mode") ;; + } + + dimension: event_param_engaged_session_event { + group_label: "Event: Parameters" + label: "Session Event" + type: number + sql: (SELECT coalesce(cast(value.string_value as INT64),value.int_value) FROM UNNEST(event_params) WHERE key = "engaged_session_event") ;; + } + + dimension: event_param_engagement_time_msec { + group_label: "Event: Parameters" + label: "Engagement Time MSEC" + type: number + sql: (SELECT value.int_value FROM UNNEST(event_params) WHERE key = "engagement_time_msec") ;; + } + + dimension: event_param_entrances { + group_label: "Event: Parameters" + label: "Entrances" + type: number + sql: (SELECT value.int_value FROM UNNEST(event_params) WHERE key = "entrances") ;; + } + + dimension: event_param_ga_session_id { + group_label: "Event: Parameters" + label: "GA Session ID" + type: number + sql: (SELECT value.int_value FROM UNNEST(event_params) WHERE key = "ga_session_id") ;; + full_suggestions: yes + } + + dimension: event_param_ga_session_number { + group_label: "Event: Parameters" + label: "GA Session Number" + type: number + sql: (SELECT value.int_value FROM UNNEST(event_params) WHERE key = "ga_session_number") ;; + } + + dimension: event_param_medium { + group_label: "Event: Parameters" + label: "Medium" + type: string + sql: (SELECT value.string_value FROM UNNEST(event_params) WHERE key = "medium") ;; + full_suggestions: yes + } + + dimension: event_param_host { + group_label: "Event: Parameters" + label: "Host" + description: "Host of Page View URL" + full_suggestions: yes + type: string + sql: NET.HOST((SELECT value.string_value FROM UNNEST(event_params) WHERE key = "page_location")) ;; + } + + dimension: event_param_page { + group_label: "Event: Parameters" + label: "Page" + description: "The path of the page." + full_suggestions: yes + type: string + sql: coalesce(regexp_extract((SELECT value.string_value FROM UNNEST(event_params) WHERE key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/') ;; + } + + # The "Page" event parameter may not be enabled, in which situation the above regex query will extract the path from the page location value. + # If the "Page" event parameter is enabled, you may use this below dimension instead if desired: + # dimension: event_param_page_path { + # group_label: "Event: Parameters" + # label: "Page" + # description: "The Page Path value" + # full_suggestions: yes + # type: string + # sql: (SELECT value.string_value FROM UNNEST(event_params) WHERE key = "page") ;; + # } + + dimension: event_param_page_location { + group_label: "Event: Parameters" + label: "Page Location" + type: string + sql: (SELECT value.string_value FROM UNNEST(event_params) WHERE key = "page_location") ;; + full_suggestions: yes + } + + dimension: event_param_page_referrer { + group_label: "Event: Parameters" + label: "Page Referrer" + type: string + sql: (SELECT value.string_value FROM UNNEST(event_params) WHERE key = "page_referrer") ;; + full_suggestions: yes + } + + dimension: event_param_page_title { + group_label: "Event: Parameters" + label: "Page Title" + description: "The page's title. Multiple pages might have the same page title." + type: string + sql: (SELECT value.string_value FROM UNNEST(event_params) WHERE key = "page_title") ;; + full_suggestions: yes + } + + dimension: event_param_percent_scrolled { + group_label: "Event: Parameters" + label: "Percent Scrolled" + type: number + sql: (SELECT value.int_value FROM UNNEST(event_params) WHERE key = "percent_scrolled") ;; + } + + dimension: event_param_session_engaged { + group_label: "Event: Parameters" + label: "Session Engaged" + type: number + sql: (SELECT coalesce(cast(value.string_value as INT64),value.int_value) FROM UNNEST(event_params) WHERE key = "session_engaged") ;; + } + + dimension: event_param_source { + group_label: "Event: Parameters" + label: "Source" + type: string + sql: (SELECT value.string_value FROM UNNEST(event_params) WHERE key = "source") ;; + full_suggestions: yes + } + + dimension: event_param_synthetic_bundle { + group_label: "Event: Parameters" + label: "Synthetic Bundle" + type: number + sql: (SELECT coalesce(cast(value.string_value as INT64),value.int_value) FROM UNNEST(event_params) WHERE key = "synthetic_bundle") ;; + } + + dimension: event_param_term { + # group_label: "Event: Parameters" + # label: "Term" + view_label: "Acquisition" + group_label: "Advertising" + label: "Keyword" + description: "The Event keyword of the traffic source, usually set when the trafficSource.medium is 'organic' or 'cpc'. Can be set by the utm_term URL parameter." + type: string + sql: (SELECT value.string_value FROM UNNEST(event_params) WHERE key = "term") ;; + full_suggestions: yes + } + +} diff --git a/views/event_data_dimensions/event_data_user_properties.view.lkml b/views/event_data_dimensions/event_data_user_properties.view.lkml new file mode 100644 index 0000000..501db78 --- /dev/null +++ b/views/event_data_dimensions/event_data_user_properties.view.lkml @@ -0,0 +1,101 @@ +view: event_data_user_properties { + extension: required + +## Dimensions + dimension: user_property_age { + group_label: "User Properties" + label: "Age" + type: string + sql: (SELECT value.string_value FROM UNNEST(event_params) WHERE key = "age") ;; + full_suggestions: yes + } + + dimension: user_property_country { + group_label: "User Properties" + label: "Country" + type: string + sql: (SELECT value.string_value FROM UNNEST(event_params) WHERE key = "country") ;; + full_suggestions: yes + } + + dimension: user_property_device_category { + group_label: "User Properties" + label: "Device Category" + type: string + sql: (SELECT value.string_value FROM UNNEST(event_params) WHERE key = "device_category") ;; + full_suggestions: yes + } + + dimension: user_property_device_model { + group_label: "User Properties" + label: "Device Model" + type: string + sql: (SELECT value.string_value FROM UNNEST(event_params) WHERE key = "device_model") ;; + full_suggestions: yes + } + + dimension: user_property_gender { + group_label: "User Properties" + label: "Gender" + type: string + sql: (SELECT value.string_value FROM UNNEST(event_params) WHERE key = "gender") ;; + full_suggestions: yes + } + + dimension: user_property_interests { + group_label: "User Properties" + label: "Interests" + type: string + sql: (SELECT value.string_value FROM UNNEST(event_params) WHERE key = "interests") ;; + full_suggestions: yes + } + + dimension: user_property_language { + group_label: "User Properties" + label: "Language" + type: string + sql: (SELECT value.string_value FROM UNNEST(event_params) WHERE key = "language") ;; + full_suggestions: yes + } + + # dimension: key { + # type: string + # sql: ${TABLE}.key ;; + # } + + # dimension: value__double_value { + # type: number + # sql: ${TABLE}.value.double_value ;; + # group_label: "Value" + # group_item_label: "Double Value" + # } + + # dimension: value__float_value { + # type: number + # sql: ${TABLE}.value.float_value ;; + # group_label: "Value" + # group_item_label: "Float Value" + # } + + # dimension: value__int_value { + # type: number + # sql: ${TABLE}.value.int_value ;; + # group_label: "Value" + # group_item_label: "Int Value" + # } + + # dimension: value__set_timestamp_micros { + # type: number + # sql: ${TABLE}.value.set_timestamp_micros ;; + # group_label: "Value" + # group_item_label: "Set Timestamp Micros" + # } + + # dimension: value__string_value { + # type: string + # sql: ${TABLE}.value.string_value ;; + # group_label: "Value" + # group_item_label: "String Value" + # } + +} diff --git a/views/event_data_dimensions/event_funnel.view.lkml b/views/event_data_dimensions/event_funnel.view.lkml new file mode 100644 index 0000000..a8fb35a --- /dev/null +++ b/views/event_data_dimensions/event_funnel.view.lkml @@ -0,0 +1,214 @@ +view: event_funnel { +extension: required + +## Filters + filter: event_1_filter { + view_label: "Event Funnel" + group_label: "Funnel Events" + suggest_explore: sessions + suggest_dimension: events.event_name + description: "Event 1 to be used with Count of Event 1" + } + filter: event_2_filter { + view_label: "Event Funnel" + group_label: "Funnel Events" + suggest_explore: sessions + suggest_dimension: events.event_name + description: "Event 2 to be used with Count of Event 2" + } + filter: event_3_filter { + view_label: "Event Funnel" + group_label: "Funnel Events" + suggest_explore: sessions + suggest_dimension: events.event_name + description: "Event 3 to be used with Count of Event 3" + } + filter: event_4_filter { + view_label: "Event Funnel" + group_label: "Funnel Events" + suggest_explore: sessions + suggest_dimension: events.event_name + description: "Event 4 to be used with Count of Event 4" + } + filter: event_5_filter { + view_label: "Event Funnel" + group_label: "Funnel Events" + suggest_explore: sessions + suggest_dimension: events.event_name + description: "Event 5 to be used with Count of Event 5" + } + filter: event_6_filter { + view_label: "Event Funnel" + group_label: "Funnel Events" + suggest_explore: sessions + suggest_dimension: events.event_name + description: "Event 6 to be used with Count of Event 6" + } + +## Dimensions + dimension: event_1 { + type: string + hidden: yes + sql: (select event_name from UNNEST(${sessions.event_data}) where event_rank = 1) ;; + } + dimension: event_2 { + type: string + hidden: yes + sql: (select event_name from UNNEST(${sessions.event_data}) where event_rank = 2) ;; + } + dimension: event_3 { + type: string + hidden: yes + sql: (select event_name from UNNEST(${sessions.event_data}) where event_rank = 3) ;; + } + dimension: event_4 { + type: string + hidden: yes + sql: (select event_name from UNNEST(${sessions.event_data}) where event_rank = 4) ;; + } + dimension: event_5 { + type: string + hidden: yes + sql: (select event_name from UNNEST(${sessions.event_data}) where event_rank = 5) ;; + } + dimension: event_6 { + type: string + hidden: yes + sql: (select event_name from UNNEST(${sessions.event_data}) where event_rank = 6) ;; + } + + dimension: event_1_tag { + type: number + hidden: yes + sql: case when {% condition event_1_filter %} ${event_1} {% endcondition %} and ${event_1} is not null then 1 else 0 end ;; + } + dimension: event_2_tag { + type: number + hidden: yes + sql: case when {% condition event_1_filter %} ${event_1} {% endcondition %} + and {% condition event_2_filter %} ${event_2} {% endcondition %} + and ${event_2} is not null then 1 else 0 end ;; + } + dimension: event_3_tag { + type: number + hidden: yes + sql: case when {% condition event_1_filter %} ${event_1} {% endcondition %} + and {% condition event_2_filter %} ${event_2} {% endcondition %} + and {% condition event_3_filter %} ${event_3} {% endcondition %} + and ${event_2} is not null + and ${event_3} is not null then 1 else 0 end ;; + } + dimension: event_4_tag { + type: number + hidden: yes + sql: case when {% condition event_1_filter %} ${event_1} {% endcondition %} + and {% condition event_2_filter %} ${event_2} {% endcondition %} + and {% condition event_3_filter %} ${event_3} {% endcondition %} + and {% condition event_4_filter %} ${event_4} {% endcondition %} + and ${event_2} is not null + and ${event_3} is not null + and ${event_4} is not null then 1 else 0 end ;; + } + dimension: event_5_tag { + type: number + hidden: yes + sql: case when {% condition event_1_filter %} ${event_1} {% endcondition %} + and {% condition event_2_filter %} ${event_2} {% endcondition %} + and {% condition event_3_filter %} ${event_3} {% endcondition %} + and {% condition event_4_filter %} ${event_4} {% endcondition %} + and {% condition event_5_filter %} ${event_5} {% endcondition %} + and ${event_2} is not null + and ${event_3} is not null + and ${event_4} is not null + and ${event_5} is not null then 1 else 0 end ;; + } + dimension: event_6_tag { + type: number + hidden: yes + sql: case when {% condition event_1_filter %} ${event_1} {% endcondition %} + and {% condition event_2_filter %} ${event_2} {% endcondition %} + and {% condition event_3_filter %} ${event_3} {% endcondition %} + and {% condition event_4_filter %} ${event_4} {% endcondition %} + and {% condition event_5_filter %} ${event_5} {% endcondition %} + and {% condition event_6_filter %} ${event_6} {% endcondition %} + and ${event_2} is not null + and ${event_3} is not null + and ${event_4} is not null + and ${event_5} is not null + and ${event_6} is not null then 1 else 0 end ;; + } + + +## Measures + measure: count_of_event_1 { + view_label: "Event Funnel" + type: sum + sql: ${event_1_tag} ;; + label: "{% if event_1_filter._in_query %} + {{_filters['event_1_filter']}} + {% else %} + Count of Event 1 + {% endif %}" + description: "Count of Event 1 to be used with Event 1 filter, if no filter is selected it shows all events" + } + + measure: count_of_event_2 { + view_label: "Event Funnel" + type: sum + sql: ${event_2_tag} ;; + label: "{% if event_2_filter._in_query %} + {{_filters['event_2_filter']}} + {% else %} + Count of Event 2 + {% endif %}" + description: "Count of Event 2 to be used with Event 2 filter, if no filter is selected it shows all events" + } + + measure: count_of_event_3 { + view_label: "Event Funnel" + type: sum + sql: ${event_3_tag} ;; + label: "{% if event_3_filter._in_query %} + {{_filters['event_3_filter']}} + {% else %} + Count of Event 3 + {% endif %}" + description: "Count of Event 3 to be used with Event 3 filter, if no filter is selected it shows all events" + } + + measure: count_of_event_4 { + view_label: "Event Funnel" + type: sum + sql: ${event_4_tag} ;; + label: "{% if event_4_filter._in_query %} + {{_filters['event_4_filter']}} + {% else %} + Count of Event 4 + {% endif %}" + description: "Count of Event 4 to be used with Event 4 filter, if no filter is selected it shows all events" + } + + measure: count_of_event_5 { + view_label: "Event Funnel" + type: sum + sql: ${event_5_tag} ;; + label: "{% if event_5_filter._in_query %} + {{_filters['event_5_filter']}} + {% else %} + Count of Event 5 + {% endif %}" + description: "Count of Event 5 to be used with Event 5 filter, if no filter is selected it shows all events" + } + + measure: count_of_event_6 { + view_label: "Event Funnel" + type: sum + sql: ${event_6_tag} ;; + label: "{% if event_6_filter._in_query %} + {{_filters['event_6_filter']}} + {% else %} + Count of Event 6 + {% endif %}" + description: "Count of Event 6 to be used with Event 6 filter, if no filter is selected it shows all events" + } +} diff --git a/views/event_data_dimensions/event_path.view.lkml b/views/event_data_dimensions/event_path.view.lkml new file mode 100644 index 0000000..1677fd5 --- /dev/null +++ b/views/event_data_dimensions/event_path.view.lkml @@ -0,0 +1,297 @@ +## Purpose: This view is for defining the "Event Path" dimensions, it is extended into events.view + +## The default Event Path is comprised of the Event Name and the Page Location URL Path. +## In the SQL definitions below, the Event Name is called by "event_history.event_name" +## The Page Location URL Path is called by coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") +## It is likely that additional customization of the event path will be required after non-default GA4 Tags are added to your event parameters. +## Using the [ (select value.value_type from UNNEST(event_params) where key = "GA4_TAG") ] format will facilitate adding these new tags to the event path. + +view: event_path { + extension: required + + ## Event Path Dimensions + dimension: event_path_1 { + view_label: "Event Flow" + group_label: "Event Path" + description: "1st Event in Session." + type: string + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = 1 limit 1) ;; + #sql: case when ${event_rank} = 1 then ${full_event} else null end ;; + full_suggestions: yes + } + dimension: event_path_2 { + view_label: "Event Flow" + group_label: "Event Path" + description: "2nd Event in Session." + type: string + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = 2 limit 1) ;; + #sql: case when ${event_rank} = 2 then ${full_event} else null end ;; + full_suggestions: yes + } + dimension: event_path_3 { + view_label: "Event Flow" + group_label: "Event Path" + description: "3rd Event in Session." + type: string + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = 3 limit 1) ;; + # sql: case when ${event_rank} = 3 then ${full_event} else null end ;; + full_suggestions: yes + } + dimension: event_path_4 { + view_label: "Event Flow" + group_label: "Event Path" + description: "4th Event in Session." + type: string + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = 4 limit 1) ;; + # sql: case when ${event_rank} = 4 then ${full_event} else null end ;; + full_suggestions: yes + } + dimension: event_path_5 { + view_label: "Event Flow" + group_label: "Event Path" + description: "5th Event in Session." + type: string + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = 5 limit 1) ;; + # sql: case when ${event_rank} = 5 then ${full_event} else null end ;; + full_suggestions: yes + } + dimension: event_path_6 { + view_label: "Event Flow" + group_label: "Event Path" + description: "6th Event in Session." + type: string + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = 6 limit 1) ;; + # sql: case when ${event_rank} = 6 then ${full_event} else null end ;; + full_suggestions: yes + } + dimension: event_path_7 { + view_label: "Event Flow" + group_label: "Event Path" + description: "7th Event in Session." + type: string + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = 7 limit 1) ;; + # sql: case when ${event_rank} = 7 then ${full_event} else null end ;; + full_suggestions: yes + } + dimension: event_path_8 { + view_label: "Event Flow" + group_label: "Event Path" + description: "8th Event in Session." + type: string + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = 8 limit 1) ;; + # sql: case when ${event_rank} = 8 then ${full_event} else null end ;; + full_suggestions: yes + } + dimension: event_path_9 { + view_label: "Event Flow" + group_label: "Event Path" + description: "9th Event in Session." + type: string + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = 9 limit 1) ;; + # sql: case when ${event_rank} = 9 then ${full_event} else null end ;; + full_suggestions: yes + } + + ## Relative full_event Path Dimensions + dimension: current_event_plus_1 { + view_label: "Event Flow" + group_label: "Relative Event Path" + description: "Event Path for Event that came directly before current Event." + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = (${TABLE}.event_rank + 1) limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_event_plus_2 { + view_label: "Event Flow" + group_label: "Relative Event Path" + description: "Event Path for Event that came 2 Events before current Event." + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = (${TABLE}.event_rank + 2) limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_event_plus_3 { + view_label: "Event Flow" + group_label: "Relative Event Path" + description: "Event Path for Event that came 3 Events before current Event." + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = (${TABLE}.event_rank + 3) limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_event_plus_4 { + view_label: "Event Flow" + group_label: "Relative Event Path" + description: "Event Path for Event that came 4 Events before current Event." + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = (${TABLE}.event_rank + 4) limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_event_plus_5 { + view_label: "Event Flow" + group_label: "Relative Event Path" + description: "Event Path for Event that came 5 Events before current Event." + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = (${TABLE}.event_rank + 5) limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_event_plus_6 { + view_label: "Event Flow" + group_label: "Relative Event Path" + description: "Event Path for Event that came 6 Events before current Event." + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = (${TABLE}.event_rank + 6) limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_event_plus_7 { + view_label: "Event Flow" + group_label: "Relative Event Path" + description: "Event Path for Event that came 7 Events before current Event." + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = (${TABLE}.event_rank + 7) limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_event_plus_8 { + view_label: "Event Flow" + group_label: "Relative Event Path" + description: "Event Path for Event that came 8 Events before current Event." + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = (${TABLE}.event_rank + 8) limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_event_plus_9 { + view_label: "Event Flow" + group_label: "Relative Event Path" + description: "Event Path for Event that came 9 Events before current Event." + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = (${TABLE}.event_rank + 9) limit 1) ;; + full_suggestions: yes + type: string + } + + ## Reverse full_event Path Dimensions + + dimension: current_event_minus_1 { + view_label: "Event Flow" + group_label: "Reverse Event Path" + description: "Event Path for Event that came directly after current Event." + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = (${TABLE}.event_rank - 1) limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_event_minus_2 { + view_label: "Event Flow" + group_label: "Reverse Event Path" + description: "Event Path for Event that came 2 Events after current Event." + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = (${TABLE}.event_rank - 2) limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_event_minus_3 { + view_label: "Event Flow" + group_label: "Reverse Event Path" + description: "Event Path for Event that came 3 Events after current Event." + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = (${TABLE}.event_rank - 3) limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_event_minus_4 { + view_label: "Event Flow" + group_label: "Reverse Event Path" + description: "Event Path for Event that came 4 Events after current Event." + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = (${TABLE}.event_rank - 4) limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_event_minus_5 { + view_label: "Event Flow" + group_label: "Reverse Event Path" + description: "Event Path for Event that came 5 Events after current Event." + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = (${TABLE}.event_rank - 5) limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_event_minus_6 { + view_label: "Event Flow" + group_label: "Reverse Event Path" + description: "Event Path for Event that came 6 Events after current Event." + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = (${TABLE}.event_rank - 6) limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_event_minus_7 { + view_label: "Event Flow" + group_label: "Reverse Event Path" + description: "Event Path for Event that came 7 Events after current Event." + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = (${TABLE}.event_rank - 7) limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_event_minus_8 { + view_label: "Event Flow" + group_label: "Reverse Event Path" + description: "Event Path for Event that came 8 Events after current Event." + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = (${TABLE}.event_rank - 8) limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_event_minus_9 { + view_label: "Event Flow" + group_label: "Reverse Event Path" + description: "Event Path for Event that came 9 Events after current Event." + sql: (select event_history.event_name||': '||coalesce(coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/'),"") + from UNNEST(${sessions.event_data}) as event_history + where event_history.event_rank = (${TABLE}.event_rank - 9) limit 1) ;; + full_suggestions: yes + type: string + } +} diff --git a/views/event_data_dimensions/goals.view.lkml b/views/event_data_dimensions/goals.view.lkml new file mode 100644 index 0000000..66b5aaf --- /dev/null +++ b/views/event_data_dimensions/goals.view.lkml @@ -0,0 +1,137 @@ +# Purpose: To house the fields used to generate Custom Goals. This file is extended into the `event_data` view. + +### +# Adding New Goal Types: +# To create a new goal type, a new filter will be created. This filter will be used to compare values of an existing dimension. +# Each filter should correspond to an existing dimension (to be used in place of ${new_dimension_to_be_filtered} in Step 2 below). +# +# 1. Add a Filter - +# filter: new_filter_name { +# label: "New Filter Label" +# view_label: "Goals" +# group_label: "Goal Selection" +# description: "New Goal Description" +# +# 2. Add your new filter to the sql parameter of the dynamic_goal, goal_in_query, and has_completed_goal dimensions - +# dimension: dynamic_goal { +# sql: IF( ${has_completed_goal}, CONCAT( +# IF({{ event_name_goal_selection._in_query }}, CONCAT(${event_name}, " "), "") +# , IF({{ page_goal_selection._in_query }}, CONCAT("on ", ${event_param_page}), "") +# ----> , IF({{ new_filter_name._in_query }}, CONCAT(${new_dimension_to_be_filtered}), "") +# ), null );; } +# +# dimension: goal_in_query { +# sql: {{ event_name_goal_selection._in_query }} +# OR {{ page_goal_selection._in_query }} +# ----> OR {{ new_filter_name._in_query }} ;; } +# +# dimension: has_completed_goal { +# sql:if( +# ${goal_in_query} +# , {% condition event_name_goal_selection %} ${event_name} {% endcondition %} +# AND {% condition page_goal_selection %} ${event_param_page} {% endcondition %} +# ----> AND {% condition new_filter_name %} ${new_dimension_to_be_filtered} {% endcondition %} +# , false +# );; } +# +# 3. Add the newly created Filter to the Custom Goals Conversion dashboard and apply to all tiles. +### + +view: goals { + extension: required + +## Filters + + filter: event_name_goal_selection { + label: "Event Name" + view_label: "Goals" + group_label: "Goal Selection" + description: "Enter Event Name to be used with Total Conversion measures." + suggest_explore: sessions + suggest_dimension: events.event_name + suggest_persist_for: "0 seconds" + type: string + } + + filter: page_goal_selection { + label: "Page" + view_label: "Goals" + group_label: "Goal Selection" + description: "Enter Page Path to be used with Conversion measures (format should be: '/'). Should not include Hostname." + suggest_explore: sessions + suggest_dimension: events.event_param_page + type: string + } + +## Dimensions + + dimension: dynamic_goal { + view_label: "Goals" + group_label: "Goals" + description: "Goal label based on Goal selection filters." + type: string + sql: IF( ${has_completed_goal}, CONCAT( + IF({{ event_name_goal_selection._in_query }}, CONCAT(${event_name}, " "), "") + , IF({{ page_goal_selection._in_query }}, CONCAT("on ", ${event_param_page}), "") + ), null );; + } + + dimension: goal_in_query { + description: "Check to verify user has entered a value for at least one goal filter." + hidden: yes + type: yesno + sql: {{ event_name_goal_selection._in_query }} + OR {{ page_goal_selection._in_query }};; + } + + dimension: has_completed_goal { + view_label: "Goals" + group_label: "Goals" + description: "A session that resulted in a conversion (i.e. resulted in reaching successful point on website defined in 'Goal Selection' field)." + type: yesno + sql:if( + ${goal_in_query} + , {% condition event_name_goal_selection %} ${event_name} {% endcondition %} + AND {% condition page_goal_selection %} ${event_param_page} {% endcondition %} + , false + );; + } + +## Measures + measure: conversion_count { + view_label: "Goals" + group_label: "Goal Conversions" + label: "Total Conversions" + description: "Total number of hits (Page or Event) that are identified as converisons based on 'Goal Selection' filters." + type: count_distinct + allow_approximate_optimization: yes + sql: ${ed_key} ;; + filters: [has_completed_goal: "yes"] + value_format_name: formatted_number + drill_fields: [] + } + + measure: sessions_with_conversions { + view_label: "Goals" + group_label: "Goal Conversions" + label: "Sessions with Conversion" + description: "Sessions that result in a conversion based on 'Goal Selection' filters." + type: count_distinct + allow_approximate_optimization: yes + sql: ${sessions.sl_key} ;; + filters: [has_completed_goal: "yes"] + value_format_name: formatted_number + drill_fields: [client_id, visit_number, sessions_with_conversions] + } + + measure: session_conversion_rate { + view_label: "Goals" + group_label: "Goal Conversions" + label: "Session Conversion Rate" + description: "Percentage of sessions resulting in a conversion based on 'Goal Selection' filters." + type: number + sql: (1.0*${sessions_with_conversions})/NULLIF(${sessions.total_sessions}, 0) ;; + value_format_name: percent_1 + drill_fields: [] + } +} diff --git a/views/event_data_dimensions/items_data.view.lkml b/views/event_data_dimensions/items_data.view.lkml new file mode 100644 index 0000000..2750329 --- /dev/null +++ b/views/event_data_dimensions/items_data.view.lkml @@ -0,0 +1,187 @@ +## Purpose: This view is for defining the 'event_data' 'Item' specific fields. This view unnested from event_data in the 'sessions' explore. + +view: event_data_items { + +## Dimensions + dimension: affiliation { + group_label: "Items" + type: string + sql: ${TABLE}.affiliation ;; + full_suggestions: yes + } + + dimension: coupon { + group_label: "Items" + type: string + sql: ${TABLE}.coupon ;; + full_suggestions: yes + } + + dimension: creative_name { + group_label: "Items" + type: string + sql: ${TABLE}.creative_name ;; + full_suggestions: yes + } + + dimension: creative_slot { + group_label: "Items" + type: string + sql: ${TABLE}.creative_slot ;; + full_suggestions: yes + } + + dimension: item_brand { + group_label: "Items" + type: string + sql: ${TABLE}.item_brand ;; + full_suggestions: yes + } + + dimension: item_category { + group_label: "Items" + type: string + sql: ${TABLE}.item_category ;; + full_suggestions: yes + } + + dimension: item_category2 { + group_label: "Items" + type: string + sql: ${TABLE}.item_category2 ;; + full_suggestions: yes + } + + dimension: item_category3 { + group_label: "Items" + type: string + sql: ${TABLE}.item_category3 ;; + full_suggestions: yes + } + + dimension: item_category4 { + group_label: "Items" + type: string + sql: ${TABLE}.item_category4 ;; + full_suggestions: yes + } + + dimension: item_category5 { + group_label: "Items" + type: string + sql: ${TABLE}.item_category5 ;; + full_suggestions: yes + } + + dimension: item_id { + group_label: "Items" + type: string + sql: ${TABLE}.item_id ;; + full_suggestions: yes + } + + dimension: item_list_id { + group_label: "Items" + type: string + sql: ${TABLE}.item_list_id ;; + full_suggestions: yes + } + + dimension: item_list_index { + group_label: "Items" + type: string + sql: ${TABLE}.item_list_index ;; + full_suggestions: yes + } + + dimension: item_list_name { + group_label: "Items" + type: string + sql: ${TABLE}.item_list_name ;; + full_suggestions: yes + } + + dimension: item_name { + group_label: "Items" + type: string + sql: ${TABLE}.item_name ;; + full_suggestions: yes + } + + dimension: item_refund { + group_label: "Items" + type: number + sql: ${TABLE}.item_refund ;; + full_suggestions: yes + } + + dimension: item_refund_in_usd { + group_label: "Items" + type: number + sql: ${TABLE}.item_refund_in_usd ;; + full_suggestions: yes + } + + dimension: item_revenue { + group_label: "Items" + type: number + sql: ${TABLE}.item_revenue ;; + full_suggestions: yes + } + + dimension: item_revenue_in_usd { + group_label: "Items" + type: number + sql: ${TABLE}.item_revenue_in_usd ;; + full_suggestions: yes + } + + dimension: item_variant { + group_label: "Items" + type: string + sql: ${TABLE}.item_variant ;; + full_suggestions: yes + } + + dimension: location_id { + group_label: "Items" + type: string + sql: ${TABLE}.location_id ;; + full_suggestions: yes + } + + dimension: price { + group_label: "Items" + type: number + sql: ${TABLE}.price ;; + full_suggestions: yes + } + + dimension: price_in_usd { + group_label: "Items" + type: number + sql: ${TABLE}.price_in_usd ;; + full_suggestions: yes + } + + dimension: promotion_id { + group_label: "Items" + type: string + sql: ${TABLE}.promotion_id ;; + full_suggestions: yes + } + + dimension: promotion_name { + group_label: "Items" + type: string + sql: ${TABLE}.promotion_name ;; + full_suggestions: yes + } + + dimension: quantity { + group_label: "Items" + type: number + sql: ${TABLE}.quantity ;; + full_suggestions: yes + } +} diff --git a/views/event_data_dimensions/page_data.view.lkml b/views/event_data_dimensions/page_data.view.lkml new file mode 100644 index 0000000..207f735 --- /dev/null +++ b/views/event_data_dimensions/page_data.view.lkml @@ -0,0 +1,442 @@ +## Purpose: This view is for defining the 'page_view' specific fields. This view is extended into 'event_data'. + +view: page_data { + extension: required + + dimension: page_view_rank { + view_label: "Page Flow" + group_label: "Page Path" + label: "Page View Rank" + description: "Rank of 'Page View' Event, 1 = First Event" + type: number + sql: ${TABLE}.page_view_rank ;; + } + + dimension: page_view_reverse_rank { + view_label: "Page Flow" + group_label: "Page Path" + label: "Page View Reverse Rank" + description: "Reverse Rank of 'Page View' Event, 1 = Last Event" + type: number + sql: ${TABLE}.page_view_reverse_rank ;; + } + + dimension: time_to_next_page { + view_label: "Behavior" + group_label: "Time on Page" + label: "Time on Page" + description: "Time user spent on page. Single page_view Sessions have 0 Duration." + type: number + sql: ${TABLE}.time_to_next_page ;; + value_format_name: hour_format + } + + dimension: is_landing_page { + view_label: "Behavior" + group_label: "Page Filters" + description: "Use to filter for first pageview of a session. Use with Page dimensions." + type: yesno + sql: ${page_view_rank} = 1 ;; + full_suggestions: yes + } + + dimension: is_exit_page { + view_label: "Behavior" + group_label: "Page Filters" + description: "If this hit was the last pageview or screenview hit of a session, this is set to true." + type: yesno + sql: ${page_view_reverse_rank} = 1 ;; + full_suggestions: yes + } + + dimension: is_bounce { + view_label: "Behavior" + group_label: "Page Filters" + label: "Is Bounce?" + description: "If this hit was the last pageview or screenview hit of a session, this is set to true." + type: yesno + sql: ${sessions.session_data_page_view_count} = 1 ;; + full_suggestions: yes + } + + ## Page Path Dimensions + dimension: page_path_1 { + view_label: "Page Flow" + group_label: "Page Path" + description: "1st Page in Session." + type: string + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = 1 + and event_history.event_name = "page_view" limit 1) ;; + # sql: case when ${page_view_rank} = 1 then ${event_param_page} else null end ;; + full_suggestions: yes + } + dimension: page_path_2 { + view_label: "Page Flow" + group_label: "Page Path" + description: "2nd Page in Session." + type: string + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = 2 + and event_history.event_name = "page_view" limit 1) ;; + # sql: case when ${page_view_rank} = 2 then ${event_param_page} else null end ;; + full_suggestions: yes + } + dimension: page_path_3 { + view_label: "Page Flow" + group_label: "Page Path" + description: "3rd Page in Session." + type: string + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = 3 + and event_history.event_name = "page_view" limit 1) ;; + # sql: case when ${page_view_rank} = 3 then ${event_param_page} else null end ;; + full_suggestions: yes + } + dimension: page_path_4 { + view_label: "Page Flow" + group_label: "Page Path" + description: "4th Page in Session." + type: string + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = 4 + and event_history.event_name = "page_view" limit 1) ;; + # sql: case when ${page_view_rank} = 4 then ${event_param_page} else null end ;; + full_suggestions: yes + } + dimension: page_path_5 { + view_label: "Page Flow" + group_label: "Page Path" + description: "5th Page in Session." + type: string + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = 5 + and event_history.event_name = "page_view" limit 1) ;; + # sql: case when ${page_view_rank} = 5 then ${event_param_page} else null end ;; + full_suggestions: yes + } + dimension: page_path_6 { + view_label: "Page Flow" + group_label: "Page Path" + description: "6th Page in Session." + type: string + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = 6 + and event_history.event_name = "page_view" limit 1) ;; + # sql: case when ${page_view_rank} = 6 then ${event_param_page} else null end ;; + full_suggestions: yes + } + dimension: page_path_7 { + view_label: "Page Flow" + group_label: "Page Path" + description: "4th Page in Session." + type: string + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = 7 + and event_history.event_name = "page_view" limit 1) ;; + # sql: case when ${page_view_rank} = 7 then ${event_param_page} else null end ;; + full_suggestions: yes + } + dimension: page_path_8 { + view_label: "Page Flow" + group_label: "Page Path" + description: "5th Page in Session." + type: string + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = 8 + and event_history.event_name = "page_view" limit 1) ;; + # sql: case when ${page_view_rank} = 8 then ${event_param_page} else null end ;; + full_suggestions: yes + } + dimension: page_path_9 { + view_label: "Page Flow" + group_label: "Page Path" + description: "6th Page in Session." + type: string + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = 9 + and event_history.event_name = "page_view" limit 1) ;; + # sql: case when ${page_view_rank} = 9 then ${event_param_page} else null end ;; + full_suggestions: yes + } + + ## Relative Page Path Dimensions + dimension: current_page_plus_1 { + view_label: "Page Flow" + group_label: "Relative Page Path" + description: "Page Path for page that came directly before current page." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = (${TABLE}.page_view_rank + 1) + and event_history.event_name = "page_view" limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_page_plus_2 { + view_label: "Page Flow" + group_label: "Relative Page Path" + description: "Page Path for page that came 2 pages before current page." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = (${TABLE}.page_view_rank + 2) + and event_history.event_name = "page_view" limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_page_plus_3 { + view_label: "Page Flow" + group_label: "Relative Page Path" + description: "Page Path for page that came 3 pages before current page." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = (${TABLE}.page_view_rank + 3) + and event_history.event_name = "page_view" limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_page_plus_4 { + view_label: "Page Flow" + group_label: "Relative Page Path" + description: "Page Path for page that came 4 pages before current page." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = (${TABLE}.page_view_rank + 4) + and event_history.event_name = "page_view" limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_page_plus_5 { + view_label: "Page Flow" + group_label: "Relative Page Path" + description: "Page Path for page that came 5 pages before current page." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = (${TABLE}.page_view_rank + 5) + and event_history.event_name = "page_view" limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_page_plus_6 { + view_label: "Page Flow" + group_label: "Relative Page Path" + description: "Page Path for page that came 6 pages before current page." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = (${TABLE}.page_view_rank + 6) + and event_history.event_name = "page_view" limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_page_plus_7 { + view_label: "Page Flow" + group_label: "Relative Page Path" + description: "Page Path for page that came 7 pages before current page." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = (${TABLE}.page_view_rank + 7) + and event_history.event_name = "page_view" limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_page_plus_8 { + view_label: "Page Flow" + group_label: "Relative Page Path" + description: "Page Path for page that came 8 pages before current page." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = (${TABLE}.page_view_rank + 8) + and event_history.event_name = "page_view" limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_page_plus_9 { + view_label: "Page Flow" + group_label: "Relative Page Path" + description: "Page Path for page that came 9 pages before current page." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = (${TABLE}.page_view_rank + 9) + and event_history.event_name = "page_view" limit 1) ;; + full_suggestions: yes + type: string + } + + ## Reverse Page Path Dimensions + dimension: current_page_minus_1 { + view_label: "Page Flow" + group_label: "Reverse Page Path" + description: "Page Path for page that came directly after current page." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = (${TABLE}.page_view_rank - 1) + and event_history.event_name = "page_view" limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_page_minus_2 { + view_label: "Page Flow" + group_label: "Reverse Page Path" + description: "Page Path for page that came 2 pages after current page." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = (${TABLE}.page_view_rank - 2) + and event_history.event_name = "page_view" limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_page_minus_3 { + view_label: "Page Flow" + group_label: "Reverse Page Path" + description: "Page Path for page that came 3 pages after current page." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = (${TABLE}.page_view_rank - 3) + and event_history.event_name = "page_view" limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_page_minus_4 { + view_label: "Page Flow" + group_label: "Reverse Page Path" + description: "Page Path for page that came 4 pages after current page." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = (${TABLE}.page_view_rank - 4) + and event_history.event_name = "page_view" limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_page_minus_5 { + view_label: "Page Flow" + group_label: "Reverse Page Path" + description: "Page Path for page that came 5 pages after current page." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = (${TABLE}.page_view_rank - 5) + and event_history.event_name = "page_view" limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_page_minus_6 { + view_label: "Page Flow" + group_label: "Reverse Page Path" + description: "Page Path for page that came 6 pages after current page." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = (${TABLE}.page_view_rank - 6) + and event_history.event_name = "page_view" limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_page_minus_7 { + view_label: "Page Flow" + group_label: "Reverse Page Path" + description: "Page Path for page that came 7 pages after current page." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = (${TABLE}.page_view_rank - 7) + and event_history.event_name = "page_view" limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_page_minus_8 { + view_label: "Page Flow" + group_label: "Reverse Page Path" + description: "Page Path for page that came 8 pages after current page." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = (${TABLE}.page_view_rank - 8) + and event_history.event_name = "page_view" limit 1) ;; + full_suggestions: yes + type: string + } + dimension: current_page_minus_9 { + view_label: "Page Flow" + group_label: "Reverse Page Path" + description: "Page Path for page that came 9 pages after current page." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_history.event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(${sessions.event_data}) as event_history + where event_history.page_view_rank = (${TABLE}.page_view_rank - 9) + and event_history.event_name = "page_view" limit 1) ;; + full_suggestions: yes + type: string + } + + + ## Measures + measure: total_entrances { + view_label: "Behavior" + group_label: "Pages" + label: "Entrances" + description: "The number of entrances to the property measured as the first pageview in a session, typically used with Landing Page." + type: count_distinct + filters: [is_landing_page: "yes"] + sql: ${ed_key} ;; + value_format_name: formatted_number + } + measure: entrance_rate { + view_label: "Behavior" + group_label: "Pages" + label: "Entrance Rate" + description:"The percentage of 'Page View' events in which this page was the entrance." + type: number + sql: ${total_entrances}/nullif(${total_page_views},0) ;; + value_format_name: percent_2 + } + measure: total_bounce { + view_label: "Behavior" + group_label: "Pages" + label: "Bounces" + type: count_distinct + sql: ${sl_key} ;; + filters: [is_bounce: "yes", event_name: "page_view"] + value_format_name: formatted_number + } + measure: bounce_rate { + view_label: "Behavior" + group_label: "Pages" + label: "Bounce Rate" + type: number + sql: ${total_bounce}/nullif(${total_page_views},0) ;; + value_format_name: percent_2 + } + measure: total_exits { + view_label: "Behavior" + group_label: "Pages" + label: "Exits" + description: "The number of exits from the property." + type: count_distinct + filters: [is_exit_page: "yes"] + sql: ${ed_key} ;; + value_format_name: formatted_number + } + measure: exit_rate { + view_label: "Behavior" + group_label: "Pages" + label: "Exit Rate" + description: "Exit is (number of exits) / (number of pageviews) for the page or set of pages. It indicates how often users exit from that page or set of pages when they view the page(s)." + type: number + sql: ${total_exits}/nullif(${total_page_views},0) ;; + value_format_name: percent_2 + } + measure: average_time_to_next_page { + view_label: "Behavior" + group_label: "Pages" + label: "Average Time on Page" + description: "Avg time a user spent on a specific page. Note that Single Page_View Sessions are excluded from this measure." + type: average + sql: coalesce(${time_to_next_page},0) ;; + filters: [time_to_next_page: ">0"] ## Filtering out 0 Duration Page View Events, which occurs when a session only has one page_view. + value_format_name: hour_format + } + +} diff --git a/views/event_data_dimensions/page_funnel.view.lkml b/views/event_data_dimensions/page_funnel.view.lkml new file mode 100644 index 0000000..eefa11c --- /dev/null +++ b/views/event_data_dimensions/page_funnel.view.lkml @@ -0,0 +1,226 @@ +view: page_funnel { +extension: required + +## Filters + filter: page_1_filter { + view_label: "Page Funnel" + group_label: "Funnel Pages" + suggest_explore: sessions + suggest_dimension: events.event_param_page + description: "Page 1 Filter, to be used with Count of Page 1" + } + + filter: page_2_filter { + view_label: "Page Funnel" + group_label: "Funnel Pages" + suggest_explore: sessions + suggest_dimension: events.event_param_page + description: "Page 2 Filter, to be used with Count of Page 2" + } + + filter: page_3_filter { + view_label: "Page Funnel" + group_label: "Funnel Pages" + suggest_explore: sessions + suggest_dimension: events.event_param_page + description: "Page 3 Filter, to be used with Count of Page 3" + } + + filter: page_4_filter { + view_label: "Page Funnel" + group_label: "Funnel Pages" + suggest_explore: sessions + suggest_dimension: events.event_param_page + description: "Page 4 Filter, to be used with Count of Page 4" + } + + filter: page_5_filter { + view_label: "Page Funnel" + group_label: "Funnel Pages" + suggest_explore: sessions + suggest_dimension: events.event_param_page + description: "Page 5 Filter, to be used with Count of Page 5" + } + + filter: page_6_filter { + view_label: "Page Funnel" + group_label: "Funnel Pages" + suggest_explore: sessions + suggest_dimension: events.event_param_page + description: "Page 6 Filter, to be used with Count of Page 6" + } + +## Dimensions + dimension: sl_key { + type: string + sql: ${TABLE}.sl_key ;; + hidden: yes + primary_key: yes + } + dimension: page_1 { + type: string + hidden: yes + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/') from UNNEST(${sessions.event_data}) where page_view_rank = 1) ;; + } + dimension: page_2 { + type: string + hidden: yes + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/') from UNNEST(${sessions.event_data}) where page_view_rank = 2) ;; + } + dimension: page_3 { + type: string + hidden: yes + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/') from UNNEST(${sessions.event_data}) where page_view_rank = 3) ;; + } + dimension: page_4 { + type: string + hidden: yes + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/') from UNNEST(${sessions.event_data}) where page_view_rank = 4) ;; + } + dimension: page_5 { + type: string + hidden: yes + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/') from UNNEST(${sessions.event_data}) where page_view_rank = 5) ;; + } + dimension: page_6 { + type: string + hidden: yes + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?#]+)"),'/') from UNNEST(${sessions.event_data}) where page_view_rank = 6) ;; + } + + dimension: page_1_tag { + type: number + hidden: yes + sql: case when {% condition page_1_filter %} ${page_1} {% endcondition %} and ${page_1} is not null then 1 else 0 end ;; + } + dimension: page_2_tag { + type: number + hidden: yes + sql: case when {% condition page_1_filter %} ${page_1} {% endcondition %} + and {% condition page_2_filter %} ${page_2} {% endcondition %} + and ${page_2} is not null then 1 else 0 end ;; + } + dimension: page_3_tag { + type: number + hidden: yes + sql: case when {% condition page_1_filter %} ${page_1} {% endcondition %} + and {% condition page_2_filter %} ${page_2} {% endcondition %} + and {% condition page_3_filter %} ${page_3} {% endcondition %} + and ${page_2} is not null + and ${page_3} is not null then 1 else 0 end ;; + } + dimension: page_4_tag { + type: number + hidden: yes + sql: case when {% condition page_1_filter %} ${page_1} {% endcondition %} + and {% condition page_2_filter %} ${page_2} {% endcondition %} + and {% condition page_3_filter %} ${page_3} {% endcondition %} + and {% condition page_4_filter %} ${page_4} {% endcondition %} + and ${page_2} is not null + and ${page_3} is not null + and ${page_4} is not null then 1 else 0 end ;; + } + dimension: page_5_tag { + type: number + hidden: yes + sql: case when {% condition page_1_filter %} ${page_1} {% endcondition %} + and {% condition page_2_filter %} ${page_2} {% endcondition %} + and {% condition page_3_filter %} ${page_3} {% endcondition %} + and {% condition page_4_filter %} ${page_4} {% endcondition %} + and {% condition page_5_filter %} ${page_5} {% endcondition %} + and ${page_2} is not null + and ${page_3} is not null + and ${page_4} is not null + and ${page_5} is not null then 1 else 0 end ;; + } + dimension: page_6_tag { + type: number + hidden: yes + sql: case when {% condition page_1_filter %} ${page_1} {% endcondition %} + and {% condition page_2_filter %} ${page_2} {% endcondition %} + and {% condition page_3_filter %} ${page_3} {% endcondition %} + and {% condition page_4_filter %} ${page_4} {% endcondition %} + and {% condition page_5_filter %} ${page_5} {% endcondition %} + and {% condition page_6_filter %} ${page_6} {% endcondition %} + and ${page_2} is not null + and ${page_3} is not null + and ${page_4} is not null + and ${page_5} is not null + and ${page_6} is not null then 1 else 0 end ;; + } + +## Measures + + measure: count_of_page_1 { + view_label: "Page Funnel" + type: sum + sql: ${page_1_tag} ;; + label: "{% if page_1_filter._in_query %} + {{_filters['page_1_filter']}} + {% else %} + Count of Page 1 + {% endif %}" + description: "Count of Page 1 to be used with Page 1 filter, if no filter is selected it shows all Pages" + } + + measure: count_of_page_2 { + view_label: "Page Funnel" + type: sum + sql: ${page_2_tag} ;; + label: "{% if page_2_filter._in_query %} + {{_filters['page_2_filter']}} + {% else %} + Count of Page 2 + {% endif %}" + description: "Count of Page 2 to be used with Page 2 filter, if no filter is selected it shows all Pages" + } + + measure: count_of_page_3 { + view_label: "Page Funnel" + type: sum + sql: ${page_3_tag} ;; + label: "{% if page_3_filter._in_query %} + {{_filters['page_3_filter']}} + {% else %} + Count of Page 3 + {% endif %}" + description: "Count of Page 3 to be used with Page 3 filter, if no filter is selected it shows all Pages" + } + + measure: count_of_page_4 { + view_label: "Page Funnel" + type: sum + sql: ${page_4_tag} ;; + label: "{% if page_4_filter._in_query %} + {{_filters['page_4_filter']}} + {% else %} + Count of Page 4 + {% endif %}" + description: "Count of Page 4 to be used with Page 4 filter, if no filter is selected it shows all Pages" + } + + measure: count_of_page_5 { + view_label: "Page Funnel" + type: sum + sql: ${page_5_tag} ;; + label: "{% if page_5_filter._in_query %} + {{_filters['page_5_filter']}} + {% else %} + Count of Page 5 + {% endif %}" + description: "Count of Page 5 to be used with Page 5 filter, if no filter is selected it shows all Pages" + } + + measure: count_of_page_6 { + view_label: "Page Funnel" + type: sum + sql: ${page_6_tag} ;; + label: "{% if page_6_filter._in_query %} + {{_filters['page_6_filter']}} + {% else %} + Count of Page 6 + {% endif %}" + description: "Count of Page 6 to be used with Page 6 filter, if no filter is selected it shows all Pages" + } + +} diff --git a/views/events.view.lkml b/views/events.view.lkml new file mode 100644 index 0000000..8afd754 --- /dev/null +++ b/views/events.view.lkml @@ -0,0 +1,721 @@ +## PURPOSE: This view is for a convenient location to define dimensions and measures sourced from the event_data element in sessions. +## Event_Data represents the source event level rows from the GA Export Dataset. +## The following views are defined in this file: +## - event_data +## - event_data_event_params +## - event_data_user_properties +## - goals +## - page_data +## - event_path + +include: "event_data_dimensions/*.view" +include: "bqml/arima_event_model/*.view" + +view: events { + extends: [event_data_event_params, event_data_user_properties, goals, page_data, event_path] + +## Dimensions + + dimension: ed_key { + type: string + primary_key: yes + hidden: yes + sql: ${sl_key}||${event_rank} ;; + } + + dimension: sl_key { + type: string + hidden: yes + sql: ${TABLE}.sl_key ;; + } + + dimension: event_rank { + label: "Event Rank" + type: number + sql: ${TABLE}.event_rank ;; + description: "Event Rank in Session, 1st Event = Event Rank 1." + full_suggestions: yes + } + + dimension: reverse_event_rank { + label: "Reverse Event Rank" + type: number + sql: ${TABLE}.reverse_event_rank ;; + description: "Reverse Event Rank in Session. Last Event = Reverse Event Rank 1." + full_suggestions: yes + } + + # dimension_group: event { + # label: "Event" + # type: time + # timeframes: [date,day_of_month,day_of_week,day_of_week_index,day_of_year,month,month_name,month_num,fiscal_quarter,fiscal_quarter_of_year,year] + # sql: ${TABLE}.event_date ;; + # } + + dimension_group: event_time { + type: time + timeframes: [date,day_of_month,day_of_week,day_of_week_index,day_of_year,month,month_name,month_num,fiscal_quarter,fiscal_quarter_of_year,year,time,hour,hour_of_day,minute,second] + label: "Event" + sql: TIMESTAMP_MICROS(${TABLE}.event_timestamp) ;; + description: "Event Date/Time from Event Timestamp." + } + parameter: event_time_window { + allowed_value: { + label: "Hourly window" + value: "hour" + } + allowed_value: { + label: "Minute window" + value: "minute" + } + default_value: "Daily" + } + + dimension: event_timestamp { hidden: yes sql: ${TABLE}.event_timestamp ;; } + + dimension: time_to_next_event { + label: "Time on Event" + description: "Time user spent on Event, measured as duration from event to the subsequent event." + sql: ${TABLE}.time_to_next_event ;; + type: number + value_format_name: hour_format + } + + dimension: event_name { + label: "Event Name" + type: string + sql: ${TABLE}.event_name ;; + full_suggestions: yes + } + + dimension: full_event { + view_label: "Behavior" + ## Customize with your specific event parameters that encompass the specific points of interest in your event. + type: string + sql: ${event_name}||': '||coalesce(${events.event_param_page},"") ;; + full_suggestions: yes + } + + dimension: event_bundle_sequence_id { + type: number + sql: ${TABLE}.event_bundle_sequence_id ;; + full_suggestions: yes + } + + dimension: event_dimensions__hostname { + type: string + sql: ${TABLE}.event_dimensions.hostname ;; + group_label: "Event Dimensions" + group_item_label: "Hostname" + full_suggestions: yes + } + + dimension: event_previous_timestamp { + type: number + sql: ${TABLE}.event_previous_timestamp ;; + full_suggestions: yes + } + + dimension: event_server_timestamp_offset { + type: number + sql: ${TABLE}.event_server_timestamp_offset ;; + full_suggestions: yes + } + + dimension: event_value_in_usd { + type: number + sql: ${TABLE}.event_value_in_usd ;; + full_suggestions: yes + } + + dimension: items { + hidden: yes + sql: ${TABLE}.items ;; + ## This is the parent dimension for the items fields within the event_data_items view. + } + + dimension: platform { + type: string + sql: ${TABLE}.platform ;; + full_suggestions: yes + } + dimension: stream_id { + type: string + sql: ${TABLE}.stream_id ;; + full_suggestions: yes + } + + ## App Info Fields + dimension: app_info__firebase_app_id { + type: string + sql: ${TABLE}.app_info.firebase_app_id ;; + full_suggestions: yes + group_label: "App Info" + group_item_label: "Firebase App ID" + } + + dimension: app_info__id { + type: string + sql: ${TABLE}.app_info.id ;; + full_suggestions: yes + group_label: "App Info" + group_item_label: "ID" + } + + dimension: app_info__install_source { + type: string + sql: ${TABLE}.app_info.install_source ;; + full_suggestions: yes + group_label: "App Info" + group_item_label: "Install Source" + } + + dimension: app_info__install_store { + type: string + sql: ${TABLE}.app_info.install_store ;; + full_suggestions: yes + group_label: "App Info" + group_item_label: "Install Store" + } + + dimension: app_info__version { + type: string + sql: ${TABLE}.app_info.version ;; + full_suggestions: yes + group_label: "App Info" + group_item_label: "Version" + } + + + ## Device Fields + dimension: device__advertising_id { + type: string + sql: ${TABLE}.device.advertising_id ;; + full_suggestions: yes + group_label: "Device" + group_item_label: "Advertising ID" + } + + dimension: device__browser { + type: string + sql: ${TABLE}.device.browser ;; + full_suggestions: yes + group_label: "Device" + group_item_label: "Browser" + } + + dimension: device__browser_version { + type: string + sql: ${TABLE}.device.browser_version ;; + full_suggestions: yes + group_label: "Device" + group_item_label: "Browser Version" + } + + dimension: device__category { + type: string + sql: ${TABLE}.device.category ;; + full_suggestions: yes + group_label: "Device" + group_item_label: "Category" + } + + dimension: device__is_limited_ad_tracking { + type: string + sql: ${TABLE}.device.is_limited_ad_tracking ;; + full_suggestions: yes + group_label: "Device" + group_item_label: "Is Limited Ad Tracking" + } + + dimension: device__language { + type: string + sql: ${TABLE}.device.language ;; + full_suggestions: yes + group_label: "Device" + group_item_label: "Language" + } + + dimension: device__mobile_brand_name { + type: string + sql: ${TABLE}.device.mobile_brand_name ;; + full_suggestions: yes + group_label: "Device" + group_item_label: "Mobile Brand Name" + } + + dimension: device__mobile_marketing_name { + type: string + sql: ${TABLE}.device.mobile_marketing_name ;; + full_suggestions: yes + group_label: "Device" + group_item_label: "Mobile Marketing Name" + } + + dimension: device__mobile_model_name { + type: string + sql: ${TABLE}.device.mobile_model_name ;; + full_suggestions: yes + group_label: "Device" + group_item_label: "Mobile Model Name" + } + + dimension: device__mobile_os_hardware_model { + type: string + sql: ${TABLE}.device.mobile_os_hardware_model ;; + full_suggestions: yes + group_label: "Device" + group_item_label: "Mobile OS Hardware Model" + } + + dimension: device__operating_system { + type: string + sql: ${TABLE}.device.operating_system ;; + full_suggestions: yes + group_label: "Device" + group_item_label: "Operating System" + } + + dimension: device__operating_system_version { + type: string + sql: ${TABLE}.device.operating_system_version ;; + full_suggestions: yes + group_label: "Device" + group_item_label: "Operating System Version" + } + + dimension: device__time_zone_offset_seconds { + type: number + sql: ${TABLE}.device.time_zone_offset_seconds ;; + group_label: "Device" + group_item_label: "Time Zone Offset Seconds" + } + + dimension: device__vendor_id { + type: string + sql: ${TABLE}.device.vendor_id ;; + full_suggestions: yes + group_label: "Device" + group_item_label: "Vendor ID" + } + + dimension: device__web_info__browser { + type: string + sql: ${TABLE}.device.web_info.browser ;; + full_suggestions: yes + group_label: "Device Web Info" + group_item_label: "Browser" + } + + dimension: device__web_info__browser_version { + type: string + sql: ${TABLE}.device.web_info.browser_version ;; + full_suggestions: yes + group_label: "Device Web Info" + group_item_label: "Browser Version" + } + + dimension: device__web_info__hostname { + type: string + sql: ${TABLE}.device.web_info.hostname ;; + full_suggestions: yes + group_label: "Device Web Info" + group_item_label: "Hostname" + } + + + ## ECommerce Fields + dimension: ecommerce__purchase_revenue { + type: number + sql: ${TABLE}.ecommerce.purchase_revenue ;; + group_label: "Ecommerce" + group_item_label: "Purchase Revenue" + value_format_name: usd + } + + dimension: ecommerce__purchase_revenue_in_usd { + type: number + sql: ${TABLE}.ecommerce.purchase_revenue_in_usd ;; + group_label: "Ecommerce" + group_item_label: "Purchase Revenue In USD" + value_format_name: usd + } + + dimension: ecommerce__refund_value { + type: number + sql: ${TABLE}.ecommerce.refund_value ;; + group_label: "Ecommerce" + group_item_label: "Refund Value" + value_format_name: usd + } + + dimension: ecommerce__refund_value_in_usd { + type: number + sql: ${TABLE}.ecommerce.refund_value_in_usd ;; + group_label: "Ecommerce" + group_item_label: "Refund Value In USD" + value_format_name: usd + } + + dimension: ecommerce__shipping_value { + type: number + sql: ${TABLE}.ecommerce.shipping_value ;; + group_label: "Ecommerce" + group_item_label: "Shipping Value" + value_format_name: usd + } + + dimension: ecommerce__shipping_value_in_usd { + type: number + sql: ${TABLE}.ecommerce.shipping_value_in_usd ;; + group_label: "Ecommerce" + group_item_label: "Shipping Value In USD" + value_format_name: usd + } + + dimension: ecommerce__tax_value { + type: number + sql: ${TABLE}.ecommerce.tax_value ;; + group_label: "Ecommerce" + group_item_label: "Tax Value" + value_format_name: usd + } + + dimension: ecommerce__tax_value_in_usd { + type: number + sql: ${TABLE}.ecommerce.tax_value_in_usd ;; + group_label: "Ecommerce" + group_item_label: "Tax Value In USD" + value_format_name: usd + } + + dimension: ecommerce__total_item_quantity { + type: number + sql: ${TABLE}.ecommerce.total_item_quantity ;; + group_label: "Ecommerce" + group_item_label: "Total Item Quantity" + value_format_name: decimal_0 + } + + dimension: ecommerce__transaction_id { + type: string + sql: ${TABLE}.ecommerce.transaction_id ;; + full_suggestions: yes + group_label: "Ecommerce" + group_item_label: "Transaction ID" + } + + dimension: ecommerce__unique_items { + type: number + sql: ${TABLE}.ecommerce.unique_items ;; + group_label: "Ecommerce" + group_item_label: "Unique Items" + value_format_name: decimal_0 + } + + + ## Geo Fields + dimension: geo__city { + type: string + sql: ${TABLE}.geo.city ;; + full_suggestions: yes + group_label: "Geo" + group_item_label: "City" + } + + dimension: geo__continent { + type: string + sql: ${TABLE}.geo.continent ;; + full_suggestions: yes + group_label: "Geo" + group_item_label: "Continent" + } + + dimension: geo__country { + type: string + sql: ${TABLE}.geo.country ;; + full_suggestions: yes + group_label: "Geo" + group_item_label: "Country" + map_layer_name: countries + } + + dimension: geo__metro { + type: string + sql: ${TABLE}.geo.metro ;; + full_suggestions: yes + group_label: "Geo" + group_item_label: "Metro" + } + + dimension: geo__region { + type: string + sql: ${TABLE}.geo.region ;; + full_suggestions: yes + group_label: "Geo" + group_item_label: "Region" + map_layer_name: us_states + } + + dimension: geo__sub_continent { + type: string + sql: ${TABLE}.geo.sub_continent ;; + full_suggestions: yes + group_label: "Geo" + group_item_label: "Sub Continent" + } + + + ## Traffic Source Fields + dimension: traffic_source__medium { + view_label: "Acquisition" + type: string + sql: ${TABLE}.traffic_source.medium ;; + full_suggestions: yes + group_label: "User Traffic Source" + group_item_label: "Medium" + description: "The medium of the traffic source for the user's original first visit (Saved up to 1 Year by Default)." + } + + dimension: traffic_source__name { + view_label: "Acquisition" + type: string + sql: ${TABLE}.traffic_source.name ;; + full_suggestions: yes + group_label: "User Traffic Source" + description: "The name of the traffic source for the user's original first visit (Saved up to 1 Year by Default)." + group_item_label: "Name" + } + + dimension: traffic_source__source { + view_label: "Acquisition" + type: string + sql: ${TABLE}.traffic_source.source ;; + full_suggestions: yes + group_label: "User Traffic Source" + group_item_label: "Source" + description: "The source of the traffic source for the user's original first visit (Saved up to 1 Year by Default)." + } + + + ## User Fields + dimension: user_first_touch_timestamp { + type: number + sql: ${TABLE}.user_first_touch_timestamp ;; + } + + dimension: user_ltv__currency { + type: string + sql: ${TABLE}.user_ltv.currency ;; + full_suggestions: yes + group_label: "User Ltv" + group_item_label: "Currency" + } + + dimension: user_ltv__revenue { + type: number + sql: ${TABLE}.user_ltv.revenue ;; + group_label: "User Ltv" + group_item_label: "Revenue" + } + + dimension: user_properties { + hidden: yes + sql: ${TABLE}.user_properties ;; + } + + dimension: user_pseudo_id { + type: string + sql: ${TABLE}.user_pseudo_id ;; + full_suggestions: yes + } + + # dimension: user_id + +## Measures + + measure: total_events { + view_label: "Behavior" + group_label: "Events" + description: "The total number of events for the session." + type: count + # view_label: "Metrics" + # group_label: "Event Data" + # label: "Total Events" + } + + measure: total_unique_events { + view_label: "Behavior" + group_label: "Events" + label: "Unique Events" + description: "Total Unique Events (Unique by Full Event Definition)" + #description: "Unique Events are interactions with content by a single user within a single session that can be tracked separately from pageviews or screenviews. " + type: count_distinct + sql: ${sl_key} ;; + } + + + measure: total_page_views { + # view_label: "Metrics" + # group_label: "Event Data" + # label: "Total Page Views" + view_label: "Behavior" + group_label: "Pages" + label: "Pageviews" + description: "The total number of pageviews for the property." + type: count + filters: [event_name: "page_view"] + value_format_name: formatted_number + } + + measure: total_unique_page_views { + # view_label: "Metrics" + # group_label: "Event Data" + # label: "Total Unique Page Views" + view_label: "Behavior" + group_label: "Pages" + label: "Unique Pageviews" + description: "Unique Pageviews are the number of sessions during which the specified page was viewed at least once. A unique pageview is counted for each page URL + page title combination." + type: count_distinct + sql: CONCAT(${event_param_ga_session_id}, ${event_param_page}, ${event_param_page_title}) ;; + value_format_name: formatted_number + filters: [event_name: "page_view"] + } + + measure: total_engaged_events { + type: count_distinct + view_label: "Behavior" + group_label: "Events" + label: "Engaged Events" + #description: "" + filters: [event_param_engaged_session_event: ">0"] + } + + ## ECommerce + + measure: total_transactions { + group_label: "Ecommerce" + label: "Transactions" + type: count_distinct + sql: ${ecommerce__transaction_id} ;; + filters: [ecommerce__transaction_id: "-(not set)"] + } + + measure: transaction_revenue_per_user { + group_label: "Ecommerce" + type: number + sql: 1.0 * (${total_purchase_revenue}/NULLIF(${sessions.total_users},0)) ;; + value_format_name: usd + } + + measure: transaction_conversion_rate { + group_label: "Ecommerce" + label: "Transaction Conversion Rate" + type: number + sql: 1.0 * (${total_transactions}/NULLIF(${sessions.total_sessions},0)) ;; + value_format_name: percent_2 + } + + measure: total_purchase_revenue { + group_label: "Ecommerce" + label: "Purchase Revenue" + type: sum_distinct + sql: ${ecommerce__purchase_revenue} ;; + sql_distinct_key: ${ecommerce__transaction_id} ;; + value_format_name: usd + } + + measure: total_purchase_revenue_usd { + group_label: "Ecommerce" + label: "Purchase Revenue (USD)" + type: sum + sql: ${ecommerce__purchase_revenue_in_usd} ;; + # sql_distinct_key: ${ecommerce__transaction_id} ;; + value_format_name: usd + } + + measure: total_refund_value { + group_label: "Ecommerce" + label: "Refund Value" + type: sum_distinct + sql: ${ecommerce__refund_value} ;; + sql_distinct_key: ${ecommerce__transaction_id} ;; + value_format_name: usd + } + + measure: total_refund_value_usd { + group_label: "Ecommerce" + label: "Refund Value (USD)" + type: sum_distinct + sql: ${ecommerce__refund_value_in_usd} ;; + sql_distinct_key: ${ecommerce__transaction_id} ;; + value_format_name: usd + } + + measure: total_shipping_value { + group_label: "Ecommerce" + label: "Shipping Value" + type: sum_distinct + sql: ${ecommerce__shipping_value} ;; + sql_distinct_key: ${ecommerce__transaction_id} ;; + value_format_name: usd + } + + measure: total_shipping_value_usd { + group_label: "Ecommerce" + label: "Shipping Value (USD)" + type: sum_distinct + sql: ${ecommerce__shipping_value_in_usd} ;; + sql_distinct_key: ${ecommerce__transaction_id} ;; + value_format_name: usd + } + + measure: total_tax_value { + group_label: "Ecommerce" + label: "Tax Value" + type: sum_distinct + sql: ${ecommerce__tax_value} ;; + sql_distinct_key: ${ecommerce__transaction_id} ;; + value_format_name: usd + } + + measure: total_tax_value_usd { + group_label: "Ecommerce" + label: "Tax Value (USD)" + type: sum_distinct + sql: ${ecommerce__tax_value_in_usd} ;; + sql_distinct_key: ${ecommerce__transaction_id} ;; + value_format_name: usd + } + + measure: total_item_quantity { + group_label: "Ecommerce" + label: "Transaction Items" + type: sum_distinct + sql: ${ecommerce__total_item_quantity} ;; + sql_distinct_key: ${ecommerce__transaction_id} ;; + value_format_name: decimal_0 + } + + measure: total_unique_items { + group_label: "Ecommerce" + label: "Unique Items" + type: sum_distinct + sql: ${ecommerce__unique_items} ;; + sql_distinct_key: ${ecommerce__transaction_id} ;; + value_format_name: decimal_0 + } + + # ----- Sets of fields for drilling ------ + set: detail { + fields: [ + event_name, + traffic_source__name, + device__mobile_model_name, + device__mobile_brand_name, + device__web_info__hostname, + event_dimensions__hostname, + device__mobile_marketing_name + ] + } +} diff --git a/views/sessions.view.lkml b/views/sessions.view.lkml new file mode 100644 index 0000000..d8c5bbf --- /dev/null +++ b/views/sessions.view.lkml @@ -0,0 +1,617 @@ +include: "/views/event_data_dimensions/event_funnel.view" +include: "/views/event_data_dimensions/page_funnel.view" +include: "/views/sessions/*.view" +include: "/views/bqml/*/*.view" + +view: sessions { + derived_table: { + sql_trigger_value: ${device_geo.SQL_TABLE_NAME} ;; + partition_keys: ["session_date"] + cluster_keys: ["session_date"] + increment_key: "session_date" + increment_offset: 3 + sql: +-- Final Select Statement: +select se.session_date as session_date + , se.ga_session_id as ga_session_id + , se.ga_session_number as ga_session_number + , se.user_pseudo_id as user_pseudo_id + , se.sl_key + -- packing session-level data into structs by category + , (SELECT AS STRUCT coalesce(sa.medium,'(none)') medium -- sessions missing last-non-direct are direct + , coalesce(sa.source,'(direct)') source + , coalesce(sa.campaign,'(direct)') campaign + , sa.page_referrer) session_attribution + , (SELECT AS STRUCT sf.session_event_count + , sf.engaged_events + , sf.session_page_view_count + , sf.is_engaged_session + , sf.is_first_visit_session + , sf.session_end + , sf.session_start + , sf.session_length_minutes) session_data + , (SELECT AS STRUCT d.device__category + , d.device__mobile_brand_name + , d.device__mobile_model_name + , d.device__mobile_device_info + , d.device__mobile_marketing_name + , d.device__mobile_os_hardware_model + , d.device__operating_system + , d.device__operating_system_version + , d.device__vendor_id + , d.device__advertising_id + , d.device__language + , d.device__time_zone_offset_seconds + , d.device__is_limited_ad_tracking + , d.device__web_info_browser + , d.device__web_info_browser_version + --, d.device__web_info_hostname + , d.device__is_mobile) device_data + , (SELECT AS STRUCT d.geo__continent + , d.geo__country + , d.geo__city + , d.geo__metro + , d.geo__sub_continent + , d.geo__region) geo_data + , se.event_data event_data +from ${session_event_packing.SQL_TABLE_NAME} as se +left join ${session_tags.SQL_TABLE_NAME} as sa + on se.sl_key = sa.sl_key +left join ${session_facts.SQL_TABLE_NAME} as sf + on se.sl_key = sf.sl_key +left join ${device_geo.SQL_TABLE_NAME} as d + on se.sl_key = d.sl_key +where {% incrementcondition %} se.session_date {% endincrementcondition %} + ;; + } + +extends: [event_funnel, page_funnel] + +## Parameters + + parameter: audience_selector { + view_label: "Audience" + description: "Use to set 'Audience Trait' field to dynamically choose a user cohort." + type: string + allowed_value: { value: "Device" } + allowed_value: { value: "Operating System" } + allowed_value: { value: "Browser" } + allowed_value: { value: "Country" } + allowed_value: { value: "Continent" } + allowed_value: { value: "Metro" } + allowed_value: { value: "Language" } + allowed_value: { value: "Channel" } + allowed_value: { value: "Medium" } + allowed_value: { value: "Source" } + allowed_value: { value: "Source Medium" } + default_value: "Source" + } + +## Dimensions + dimension: sl_key { + type: string + sql: ${TABLE}.sl_key ;; + primary_key: yes + hidden: yes + } + + dimension_group: session { + type: time + sql: ${TABLE}.session_date ;; + } + + dimension: ga_session_id { + type: number + sql: ${TABLE}.ga_session_id ;; + } + + dimension: ga_session_number { + view_label: "Audience" + group_label: "User" + label: "Session Number" + type: number + sql: ${TABLE}.ga_session_number ;; + } + + dimension: ga_session_number_tier { + view_label: "Audience" + group_label: "User" + label: "Session Number Tier" + description: "Session Number dimension grouped in tiers between 1-100. See 'Session Number' for full description." + type: tier + tiers: [1,2,5,10,15,20,50,100] + style: integer + sql: ${ga_session_number} ;; + } + + dimension: user_pseudo_id { + type: string + sql: ${TABLE}.user_pseudo_id ;; + } + + dimension: event_data { + hidden: yes + type: string + sql: ${TABLE}.event_data ;; + ## This is the parent array that contains the event_data struct elements. It is not directly useably as a dimension. + ## It is necessary for proper unnesting in the model Join. + } + + dimension: audience_trait { + view_label: "Audience" + group_label: "Audience Cohorts" + description: "Dynamic cohort field based on value set in 'Audience Selector' filter." + type: string + sql: CASE + WHEN {% parameter audience_selector %} = 'Channel' THEN ${attribution_sources.attribution_source_channel} + WHEN {% parameter audience_selector %} = 'Medium' THEN ${session_attribution_medium} + WHEN {% parameter audience_selector %} = 'Source' THEN ${session_attribution_source} + WHEN {% parameter audience_selector %} = 'Source Medium' THEN ${session_attribution_source_medium} + WHEN {% parameter audience_selector %} = 'Device' THEN ${device_data_device_category} + WHEN {% parameter audience_selector %} = 'Browser' THEN ${device_data_web_info_browser} + WHEN {% parameter audience_selector %} = 'Metro' THEN ${geo_data_metro} + WHEN {% parameter audience_selector %} = 'Country' THEN ${geo_data_country} + WHEN {% parameter audience_selector %} = 'Continent' THEN ${geo_data_continent} + WHEN {% parameter audience_selector %} = 'Language' THEN ${device_data_language} + WHEN {% parameter audience_selector %} = 'Operating System' THEN ${device_data_operating_system} + END;; + } + + ## Entrance(Landing)/Exit + + dimension: landing_page { + view_label: "Behavior" + group_label: "Pages" + description: "Landing/Entrance Page (first 'Page View' event) of a Session." + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(sessions.event_data) as event_history + where event_history.sl_key = (sessions.sl_key) and event_history.page_view_rank = 1 limit 1) ;; + } + dimension: exit_page { + view_label: "Behavior" + group_label: "Pages" + description: "Exit Page (last 'Page View' event) of a Session." + + sql: (select coalesce(regexp_extract((select value.string_value from UNNEST(event_params) where key = "page_location"),r"(?:.*?[\.][^\/]*)([\/][^\?]+)"),'/') + from UNNEST(sessions.event_data) as event_history + where event_history.sl_key = (sessions.sl_key) and event_history.page_view_reverse_rank = 1 limit 1) ;; + } + + ## Session Data Dimensions + dimension: session_data { + type: string + sql: ${TABLE}.session_data ;; + hidden: yes + ## This is the Parent Struct that contains the session_data elements. It is not directly useably as a dimension. + ## It is referred to by its child dimensions in their sql definition. + } + dimension: session_data_session_event_count { + type: number + sql:${session_data}.session_event_count;; + label: "Session Event Count" + } + dimension: session_data_engaged_events { + type: number + sql: ${session_data}.engaged_events ;; + label: "Session Engaged Event Count" + } + dimension: session_data_page_view_count { + type: number + sql: ${session_data}.session_page_view_count ;; + label: "Page View Count" + } + dimension: session_data_is_engaged_session { + type: yesno + sql: ${session_data}.is_engaged_session ;; + label: "Is Engaged Session?" + } + dimension: session_data_is_first_visit_session { + type: yesno + sql: ${session_data}.is_first_visit_session ;; + label: "Is First Visit Session?" + } + dimension_group: session_data_session_end { + type: time + sql: ${session_data}.session_end ;; + timeframes: [raw,time,hour,hour_of_day,date,day_of_week,day_of_week_index,week,month,year] + label: "Session End" + } + dimension_group: session_data_session_start { + type: time + sql: ${session_data}.session_start ;; + timeframes: [raw,time,hour,hour_of_day,date,day_of_week,day_of_week_index,week,month,year] + label: "Session Start" + } + dimension: session_data_session_duration { + type: number + sql: ((TIMESTAMP_DIFF(${session_data_session_end_raw}, ${session_data_session_start_raw}, second))/86400.0) ;; + value_format_name: hour_format + label: "Session Duration" + } + dimension: session_data_session_duration_tier { + label: "Session Duration Tiers" + description: "The length (returned as a string) of a session measured in seconds and reported in second increments." + type: tier + sql: (${session_data_session_duration}*86400.0) ;; + tiers: [10,30,60,120,180,240,300,600] + style: integer + } + dimension: session_data_is_bounce { + type: yesno + sql: ${session_data_session_duration} = 0 ;; + label: "Is Bounce?" + description: "If Session Duration Minutes = 0 and there are no engaged events in the Session, then Bounce = True." + } + + ## Session Attribution Dimensions + dimension: session_attribution { + type: string + sql: ${TABLE}.session_attribution ;; + hidden: yes + ## This is the Parent Struct that contains the session_attribution elements. It is not directly useably as a dimension. + ## It is referred to by its child dimensions in their sql definition. + } + dimension: session_attribution_page_referrer { + # group_label: "Attribution" + # label: "Page Referrer" + view_label: "Acquisition" + group_label: "Session Traffic Source" + label: "Full Referrer" + description: "The full referring URL including the hostname and path." + type: string + sql: ${session_attribution}.page_referrer ;; + } + dimension: session_attribution_campaign { + view_label: "Acquisition" + group_label: "Advertising" + label: "Campaign" + description: "The campaign value. Usually set by the utm_campaign URL parameter." + type: string + sql: ${session_attribution}.campaign ;; + } + dimension: session_attribution_source { + view_label: "Acquisition" + group_label: "Session Traffic Source" + label: "Source" + type: string + sql: ${session_attribution}.source ;; + } + dimension: session_attribution_medium { + view_label: "Acquisition" + group_label: "Session Traffic Source" + label: "Medium" + type: string + sql: ${session_attribution}.medium ;; + } + dimension: session_attribution_source_medium { + view_label: "Acquisition" + group_label: "Session Traffic Source" + label: "Source Medium" + type: string + sql: ${session_attribution}.source||' '||${session_attribution}.medium ;; + } + + ## Session Device Data Dimensions + dimension: device_data { + type: string + sql: ${TABLE}.device_data ;; + hidden: yes + ## This is the Parent Struct that contains the device_data elements. It is not directly useably as a dimension. + ## It is referred to by its child dimensions in their sql definition. + } + dimension: device_data_device_category { + view_label: "Audience" + group_label: "Mobile" + label: "Device Category" + type: string + sql: ${device_data}.device__category ;; + } + dimension: device_data_mobile_brand_name { + view_label: "Audience" + group_label: "Mobile" + label: "Mobile Device Branding" + type: string + sql: ${device_data}.device__mobile_brand_name ;; + } + dimension: device_data_mobile_model_name { + view_label: "Audience" + group_label: "Mobile" + label: "Mobile Device Model" + type: string + sql: ${device_data}.device__mobile_model_name ;; + } + dimension: device_data_mobile_device_info { + view_label: "Audience" + group_label: "Mobile" + label: "Mobile Device Info" + type: string + sql: ${device_data}.device__mobile_device_info ;; + } + dimension: device_data_mobile_marketing_name { + view_label: "Audience" + group_label: "Mobile" + label: "Mobile Device Marketing Name" + type: string + sql: ${device_data}.device__mobile_marketing_name ;; + } + dimension: device_data_mobile_os_hardware_model { + view_label: "Audience" + group_label: "Mobile" + label: "Mobile OS Hardware Model" + type: string + sql: ${device_data}.device__mobile_os_hardware_model ;; + } + dimension: device_data_operating_system { + view_label: "Audience" + group_label: "Technology" + label: "Operating System" + type: string + sql: ${device_data}.device__operating_system ;; + } + dimension: device_data_operating_system_version { + view_label: "Audience" + group_label: "Technology" + label: "Operating System Version" + type: string + sql: ${device_data}.device__operating_system_version ;; + } + dimension: device_data_vendor_id { + hidden: yes + group_label: "Device" + label: "Vendor ID" + type: string + sql: ${device_data}.device__vendor_id ;; + } + dimension: device_data_advertising_id { + hidden: yes + group_label: "Device" + label: "Advertising ID" + type: string + sql: ${device_data}.device__advertising_id ;; + } + dimension: device_data_language { + view_label: "Audience" + group_label: "User" + label: "Language" + type: string + sql: ${device_data}.device__language ;; + } + dimension: device_data_time_zone_offset_seconds { + group_label: "Device" + label: "Time Zone Offset Seconds" + type: number + sql: ${device_data}.device__time_zone_offset_seconds ;; + } + dimension: device_data_is_limited_ad_tracking { + group_label: "Device" + label: "Is Limited Ad Tracking?" + type: string + sql: ${device_data}.device__is_limited_ad_tracking ;; + } + dimension: device_data_web_info_browser { + view_label: "Audience" + group_label: "Technology" + label: "Browser" + type: string + sql: ${device_data}.device__web_info_browser ;; + } + dimension: device_data_web_info_browser_version { + view_label: "Audience" + group_label: "Technology" + label: "Browser Version" + type: string + sql: ${device_data}.device__web_info_browser_version ;; + } + #dimension: device_data_web_info_hostname { + #group_label: "Device" + # view_label: "Behavior" + #group_label: "Pages" + #label: "Hostname" + #description: "The hostname from which the tracking request was made." + #type: string + #sql: ${device_data}.device__web_info_hostname ;; + #} + dimension: device_is_mobile { + group_label: "Device" + label: "Is Mobile?" + type: string + sql: ${device_data}.device__is_mobile ;; + description: "Is the user's device a mobile device? (Yes/No)" + } + + ## Session Geo Data Dimensions + dimension: geo_data { + type: string + sql: ${TABLE}.geo_data ;; + hidden: yes + ## This is the Parent Struct that contains the geo_data elements. It is not directly useably as a dimension. + ## It is referred to by its child dimensions in their sql definition. + } + dimension: geo_data_continent { + view_label: "Audience" + group_label: "Geo" + label: "Continent" + type: string + sql: ${geo_data}.geo__continent ;; + } + dimension: geo_data_country { + view_label: "Audience" + group_label: "Geo" + label: "Country" + type: string + sql: ${geo_data}.geo__country ;; + map_layer_name: countries + } + dimension: geo_data_city { + view_label: "Audience" + group_label: "Geo" + label: "City" + type: string + sql: ${geo_data}.geo__city ;; + } + dimension: geo_data_metro { + view_label: "Audience" + group_label: "Geo" + label: "Metro" + type: string + sql: ${geo_data}.geo__metro ;; + } + dimension: geo_data_sub_continent { + view_label: "Audience" + group_label: "Geo" + label: "Sub-Continent" + type: string + sql: ${geo_data}.geo__sub_continent ;; + } + dimension: geo_data_region { + view_label: "Audience" + group_label: "Geo" + label: "Region" + type: string + sql: ${geo_data}.geo__region ;; + map_layer_name: us_states + } + +## Measures + + measure: total_sessions { + group_label: "Session" + label: "Sessions" + description: "Total Number of Sessions (Count)" + type: count_distinct + sql: ${sl_key} ;; + value_format_name: formatted_number + drill_fields: [session_attribution_source_medium,total_sessions,total_new_users,events.total_page_views,average_session_duration] + } + + measure: total_first_visit_sessions { + group_label: "Session" + label: "New Sessions" + description: "Total Number of 'First Visit' Sessions (Count)" + type: count_distinct + sql: ${sl_key} ;; + filters: [session_data_is_first_visit_session: "yes"] + value_format_name: formatted_number + } + + measure: total_first_visit_sessions_percentage { + group_label: "Session" + label: "New Sessions %" + description: "Percentage of New Sessions out of All Sessions" + type: number + sql: ${total_first_visit_sessions}/nullif(${total_sessions},0) ;; + value_format_name: percent_2 + } + + measure: total_engaged_sessions { + group_label: "Session" + label: "Engaged Sessions" + description: "Total Number of Sessions w/ Engaged Event" + type: count_distinct + sql: ${sl_key} ;; + filters: [session_data_is_engaged_session: "yes"] + value_format_name: formatted_number + } + + measure: total_engaged_sessions_percentage { + group_label: "Session" + label: "Engaged Sessions %" + type: number + sql: ${total_engaged_sessions}/nullif(${total_sessions},0) ;; + value_format_name: percent_2 + } + + measure: average_page_views_per_session { + group_label: "Session" + label: "Avg. Page Views per Session" + description: "Average Count of 'Page_View' events within each Session." + type: average + sql: ${session_data_page_view_count} ;; + value_format_name: decimal_2 + } + + measure: total_bounced_sessions { + group_label: "Session" + label: "Bounces" + description: "Total Number of Sessions with 0 Duration w/out Engagement" + type: count_distinct + sql: ${sl_key} ;; + filters: [session_data_is_bounce: "yes"] + value_format_name: formatted_number + } + + measure: total_bounced_sessions_percentage { + group_label: "Session" + label: "Bounce Rate" + description: "Percentage of Bounce Sessions out of All Sessions" + type: number + sql: ${total_bounced_sessions}/nullif(${total_sessions},0) ;; + value_format_name: percent_2 + } + + measure: average_session_duration { + group_label: "Session" + label: "Avg. Session Duration" + description: "The Average Session Duration in HH:MM:SS Format" + type: average + sql: ${session_data_session_duration} ;; + value_format_name: hour_format + } + + measure: total_users { + view_label: "Audience" + group_label: "User" + label: "Users" + description: "Distinct/Unique count of Users" + type: count_distinct + sql: ${user_pseudo_id} ;; + value_format_name: formatted_number + } + #measure: total_event_count { + # type: sum + # description: "Total times an event occured on a specific date" + # sql: ${session_data_session_event_count} ;; + # value_format_name: formatted_number + #} + + measure: total_new_users { + view_label: "Audience" + group_label: "User" + label: "New Users" + description: "Distinct/Unique count of User Pseudo ID where GA Session Number = 1" + type: count_distinct + sql: ${user_pseudo_id} ;; + filters: [session_data_is_first_visit_session: "yes"] + value_format_name: formatted_number + } + + measure: total_returning_users { + view_label: "Audience" + group_label: "User" + label: "Returning Users" + description: "Distinct/Unique count of User Pseudo ID where GA Session Number > 1" + type: count_distinct + sql: ${user_pseudo_id} ;; + filters: [session_data_is_first_visit_session: "no"] + value_format_name: formatted_number + } + + measure: percentage_new_users { + view_label: "Audience" + group_label: "User" + label: "% New Users" + type: number + sql: ${total_new_users}/nullif(${total_users},0) ;; + value_format_name: percent_2 + } + + measure: percentage_returning_users { + view_label: "Audience" + group_label: "User" + label: "% Returning Users" + type: number + sql: ${total_returning_users}/nullif(${total_users},0) ;; + value_format_name: percent_2 + } + +} diff --git a/views/sessions/device_geo.view.lkml b/views/sessions/device_geo.view.lkml new file mode 100644 index 0000000..0c83e55 --- /dev/null +++ b/views/sessions/device_geo.view.lkml @@ -0,0 +1,32 @@ +include: "/views/sessions/*.view.lkml" +view: device_geo{ + derived_table:{ + sql_trigger_value: ${session_event_packing.SQL_TABLE_NAME} ;; + sql:select sl.sl_key + , sl.device.category device__category + , sl.device.mobile_brand_name device__mobile_brand_name + , sl.device.mobile_model_name device__mobile_model_name + , sl.device.mobile_brand_name||' '||device.mobile_model_name device__mobile_device_info + , sl.device.mobile_marketing_name device__mobile_marketing_name + , sl.device.mobile_os_hardware_model device__mobile_os_hardware_model + , sl.device.operating_system device__operating_system + , sl.device.operating_system_version device__operating_system_version + , sl.device.vendor_id device__vendor_id + , sl.device.advertising_id device__advertising_id + , sl.device.language device__language + , sl.device.time_zone_offset_seconds device__time_zone_offset_seconds + , sl.device.is_limited_ad_tracking device__is_limited_ad_tracking + , sl.device.web_info.browser device__web_info_browser + , sl.device.web_info.browser_version device__web_info_browser_version + --, sl.device.web_info.hostname device__web_info_hostname + , case when sl.device.category = 'mobile' then true else false end as device__is_mobile + , sl.geo.continent geo__continent + , sl.geo.country geo__country + , sl.geo.city geo__city + , sl.geo.metro geo__metro + , sl.geo.sub_continent geo__sub_continent + , sl.geo.region geo__region + from ${session_list_with_event_history.SQL_TABLE_NAME} AS sl + where sl.event_name = 'session_start' ;; + } +} diff --git a/views/sessions/session_event_packing.view.lkml b/views/sessions/session_event_packing.view.lkml new file mode 100644 index 0000000..f4d2b3f --- /dev/null +++ b/views/sessions/session_event_packing.view.lkml @@ -0,0 +1,53 @@ +include: "/views/sessions/*.view.lkml" +view: session_event_packing { + derived_table:{ + sql_trigger_value: ${session_facts.SQL_TABLE_NAME} ;; + partition_keys: ["session_date"] + cluster_keys: ["sl_key","user_pseudo_id","session_date"] + increment_key: "session_date" + increment_offset: 0 + sql:select sl.session_date session_date + , sl.ga_session_id ga_session_id + , sl.ga_session_number ga_session_number + , sl.user_pseudo_id user_pseudo_id + , sl.sl_key + , ARRAY_AGG(STRUCT(sl.sl_key + , sl.event_rank + , sl.page_view_rank + , sl.page_view_reverse_rank + , sl.time_to_next_event + , sl.time_to_next_page + , sl.event_date + , sl.event_timestamp + , sl.event_name + , sl.event_params + , sl.event_previous_timestamp + , sl.event_value_in_usd + , sl.event_bundle_sequence_id + , sl.event_server_timestamp_offset + , sl.user_id + , sl.user_pseudo_id + , sl.user_properties + , sl.user_first_touch_timestamp + , sl.user_ltv + , sl.device + , sl.geo + , sl.app_info + , sl.traffic_source + , sl.stream_id + , sl.platform + , sl.event_dimensions + , sl.ecommerce + , sl.items)) event_data + from ${session_list_with_event_history.SQL_TABLE_NAME} AS sl + WHERE sl.sl_key IN (SELECT sl_key FROM ${session_facts.SQL_TABLE_NAME} + WHERE CASE WHEN "@{EVENT_COUNT}" = "" THEN 1=1 WHEN "@{EVENT_COUNT}" != "" THEN + session_event_count< SAFE_CAST("@{EVENT_COUNT}" AS INT64) END) + AND {% incrementcondition %} session_date {% endincrementcondition %} + group by 1,2,3,4,5;; + } + dimension: session_date{ + type: date + hidden: yes + } +} diff --git a/views/sessions/session_facts.view.lkml b/views/sessions/session_facts.view.lkml new file mode 100644 index 0000000..5ec7161 --- /dev/null +++ b/views/sessions/session_facts.view.lkml @@ -0,0 +1,20 @@ +include: "/views/sessions/*.view.lkml" +view: session_facts{ + derived_table: { + #datagroup_trigger: ga4_main_datagroup + sql_trigger_value: ${session_tags.SQL_TABLE_NAME} ;; + sql: select sl.sl_key as sl_key + , COUNT(sl.event_timestamp) session_event_count + , SUM(case when sl.event_name = 'page_view' then 1 else 0 end) session_page_view_count + , COALESCE(SUM((select value.int_value from UNNEST(sl.event_params) where key = "engaged_session_event")),0) engaged_events + , case when (COALESCE(SUM((select value.int_value from UNNEST(sl.event_params) where key = "engaged_session_event")),0) = 0 + and COALESCE(SUM((select coalesce(SAFE_CAST(value.string_value as INT64),value.int_value) from UNNEST(sl.event_params) where key = "session_engaged"))) = 0) + then false else true end as is_engaged_session + , case when countif(event_name = 'first_visit') = 0 then false else true end as is_first_visit_session + , MAX(TIMESTAMP_MICROS(sl.event_timestamp)) as session_end + , MIN(TIMESTAMP_MICROS(sl.event_timestamp)) as session_start + , (MAX(sl.event_timestamp) - MIN(sl.event_timestamp))/(60 * 1000 * 1000) AS session_length_minutes + from ${session_list_with_event_history.SQL_TABLE_NAME} AS sl + group by 1;; + } +} diff --git a/views/sessions/session_list_with_event_history.view.lkml b/views/sessions/session_list_with_event_history.view.lkml new file mode 100644 index 0000000..f750484 --- /dev/null +++ b/views/sessions/session_list_with_event_history.view.lkml @@ -0,0 +1,61 @@ +include: "/views/event_data_dimensions/event_funnel.view" +include: "/views/event_data_dimensions/page_funnel.view" + +view: session_list_with_event_history { + derived_table: { + datagroup_trigger: ga4_main_datagroup + partition_keys: ["session_date"] + cluster_keys: ["sl_key","user_id","session_date"] + increment_key: "session_date" + increment_offset: 0 + sql:-- obtains a list of sessions, uniquely identified by the table date, ga_session_id event parameter, ga_session_number event parameter, and the user_pseudo_id. + select timestamp(SAFE.PARSE_DATE('%Y%m%d', REGEXP_EXTRACT(_TABLE_SUFFIX,r'(\d{8})'))) session_date + , (select value.int_value from UNNEST(events.event_params) where key = "ga_session_id") ga_session_id + , (select value.int_value from UNNEST(events.event_params) where key = "ga_session_number") ga_session_number + , events.user_pseudo_id + -- unique key for session: + , timestamp(SAFE.PARSE_DATE('%Y%m%d', REGEXP_EXTRACT(_TABLE_SUFFIX,r'[0-9]+')))||(select value.int_value from UNNEST(events.event_params) where key = "ga_session_id")||(select value.int_value from UNNEST(events.event_params) where key = "ga_session_number")||events.user_pseudo_id as sl_key + , row_number() over (partition by (timestamp(SAFE.PARSE_DATE('%Y%m%d', REGEXP_EXTRACT(_TABLE_SUFFIX,r'[0-9]+')))||(select value.int_value from UNNEST(events.event_params) where key = "ga_session_id")||(select value.int_value from UNNEST(events.event_params) where key = "ga_session_number")||events.user_pseudo_id) order by events.event_timestamp) event_rank + , (TIMESTAMP_DIFF(TIMESTAMP_MICROS(LEAD(events.event_timestamp) OVER (PARTITION BY timestamp(SAFE.PARSE_DATE('%Y%m%d', REGEXP_EXTRACT(_TABLE_SUFFIX,r'[0-9]+')))||(select value.int_value from UNNEST(events.event_params) where key = "ga_session_id")||(select value.int_value from UNNEST(events.event_params) where key = "ga_session_number")||events.user_pseudo_id ORDER BY events.event_timestamp asc)) + ,TIMESTAMP_MICROS(events.event_timestamp),second)/86400.0) time_to_next_event + , case when events.event_name = 'page_view' then row_number() over (partition by (timestamp(SAFE.PARSE_DATE('%Y%m%d', REGEXP_EXTRACT(_TABLE_SUFFIX,r'[0-9]+')))||(select value.int_value from UNNEST(events.event_params) where key = "ga_session_id")||(select value.int_value from UNNEST(events.event_params) where key = "ga_session_number")||events.user_pseudo_id), case when events.event_name = 'page_view' then true else false end order by events.event_timestamp) + else 0 end as page_view_rank + , case when events.event_name = 'page_view' then row_number() over (partition by (timestamp(SAFE.PARSE_DATE('%Y%m%d', REGEXP_EXTRACT(_TABLE_SUFFIX,r'[0-9]+')))||(select value.int_value from UNNEST(events.event_params) where key = "ga_session_id")||(select value.int_value from UNNEST(events.event_params) where key = "ga_session_number")||events.user_pseudo_id), case when events.event_name = 'page_view' then true else false end order by events.event_timestamp desc) + else 0 end as page_view_reverse_rank + , case when events.event_name = 'page_view' then (TIMESTAMP_DIFF(TIMESTAMP_MICROS(LEAD(events.event_timestamp) OVER (PARTITION BY timestamp(SAFE.PARSE_DATE('%Y%m%d', REGEXP_EXTRACT(_TABLE_SUFFIX,r'[0-9]+')))||(select value.int_value from UNNEST(events.event_params) where key = "ga_session_id")||(select value.int_value from UNNEST(events.event_params) where key = "ga_session_number")||events.user_pseudo_id , case when events.event_name = 'page_view' then true else false end ORDER BY events.event_timestamp asc)) + ,TIMESTAMP_MICROS(events.event_timestamp),second)/86400.0) else null end as time_to_next_page -- this window function yields 0 duration results when session page_view count = 1. + -- raw event data: + , events.event_date + , events.event_timestamp + , events.event_name + , events.event_params + , events.event_previous_timestamp + , events.event_value_in_usd + , events.event_bundle_sequence_id + , events.event_server_timestamp_offset + , events.user_id + -- , events.user_pseudo_id + , events.user_properties + , events.user_first_touch_timestamp + , events.user_ltv + , events.device + , events.geo + , events.app_info + , events.traffic_source + , events.stream_id + , events.platform + , events.event_dimensions + , events.ecommerce + , ARRAY(select as STRUCT it.* EXCEPT(item_params) from unnest(events.items) as it) as items + from `@{GA4_SCHEMA}.@{GA4_TABLE_VARIABLE}` events + where {% incrementcondition %} timestamp(PARSE_DATE('%Y%m%d', REGEXP_EXTRACT(_TABLE_SUFFIX,r'[0-9]+'))) {% endincrementcondition %} + --where timestamp(PARSE_DATE('%Y%m%d', REGEXP_EXTRACT(_TABLE_SUFFIX,r'[0-9]+'))) >= ((TIMESTAMP_ADD(TIMESTAMP_TRUNC(CURRENT_TIMESTAMP(), DAY), INTERVAL -15 DAY))) + --and timestamp(PARSE_DATE('%Y%m%d', REGEXP_EXTRACT(_TABLE_SUFFIX,r'[0-9]+'))) <= ((TIMESTAMP_ADD(TIMESTAMP_ADD(TIMESTAMP_TRUNC(CURRENT_TIMESTAMP(), DAY), INTERVAL -15 DAY), INTERVAL 16 DAY))) + ;; + } + dimension: session_date { + type: date + hidden: yes + sql: ${TABLE}.session_date;; + } + } diff --git a/views/sessions/session_tags.view.lkml b/views/sessions/session_tags.view.lkml new file mode 100644 index 0000000..857808c --- /dev/null +++ b/views/sessions/session_tags.view.lkml @@ -0,0 +1,35 @@ +include: "/views/sessions/*.view.lkml" +view: session_tags{ + derived_table:{ + increment_key: "session_date" + partition_keys: ["session_date"] + cluster_keys: ["sl_key","session_date"] + #datagroup_trigger: ga4_default_datagroup + sql_trigger_value: ${session_list_with_event_history.SQL_TABLE_NAME} ;; + sql:SELECT DISTINCT sl.sl_key, sl.session_date + , CASE WHEN key = 'medium' THEN value.string_value END AS medium + , CASE WHEN key = 'source' THEN value.string_value END AS source + , CASE WHEN key = 'campaign' THEN value.string_value END AS campaign + , CASE WHEN key = 'page_referrer' THEN value.string_value END AS page_referrer +FROM ( + SELECT sl_key, sl3.session_date, key, value,event_timestamp + FROM ${session_list_with_event_history.SQL_TABLE_NAME} sl3 + CROSS JOIN UNNEST(sl3.event_params) AS sl1 + WHERE event_name in ('page_view') + AND key IN ('medium','source','campaign','page_referrer') + AND sl_key IS NOT NULL +) AS sl +JOIN ( + SELECT sl2.sl_key, sl2.session_date, MIN(event_timestamp) AS min_event_timestamp + FROM ${session_list_with_event_history.SQL_TABLE_NAME} AS sl2 + GROUP BY sl2.sl_key, sl2.session_date +) AS min_events ON sl.sl_key = min_events.sl_key AND sl.session_date = min_events.session_date +WHERE sl.event_timestamp = min_events.min_event_timestamp +and {% incrementcondition %} sl.session_date {% endincrementcondition %};; + } + dimension: session_date { + type: date + hidden: yes + sql: ${TABLE}.session_date ;; + } +} diff --git a/views/user_first_session.view.lkml b/views/user_first_session.view.lkml new file mode 100644 index 0000000..5ecd4c2 --- /dev/null +++ b/views/user_first_session.view.lkml @@ -0,0 +1,38 @@ +view: user_first_session { + derived_table: { + explore_source: sessions { + column: sl_key {} + column: user_pseudo_id {} + column: session_data_session_end_time {} + column: session_data_session_start_time {} + derived_column: first_session_end_time { + sql: min(session_data_session_end_time) over (partition by user_pseudo_id order by session_data_session_start_time) ;; + } + } + } + dimension: sl_key { hidden:yes } + dimension: session_data_session_start_time { hidden:yes } + dimension_group: first_session_end_time { + hidden: yes + type: time + timeframes: [hour,date,week,year,raw] + } + dimension_group: since_previous_session { + view_label: "Audience" + group_label: "User" + type: duration + intervals: [hour,day] + sql_start: ${first_session_end_time_raw} ;; + sql_end: ${session_data_session_start_time} ;; + } + dimension: days_since_first_session_tier { + view_label: "Audience" + group_label: "User" + description: "Days since the first session. 0 if user only has 1 session." + type: tier + style: integer + tiers: [1,2,4,8,15,31,61,121,365] + sql: ${days_since_previous_session};; + } + + } diff --git a/views/user_previous_session.view.lkml b/views/user_previous_session.view.lkml new file mode 100644 index 0000000..b069a47 --- /dev/null +++ b/views/user_previous_session.view.lkml @@ -0,0 +1,37 @@ +view: user_previous_session { + derived_table: { + explore_source: sessions { + column: sl_key {} + column: user_pseudo_id {} + column: session_data_session_end_time {} + column: session_data_session_start_time {} + derived_column: prev_session_end_time { + sql: lag(session_data_session_end_time) over (partition by user_pseudo_id order by session_data_session_start_time) ;; + } + } + } + dimension: sl_key { hidden:yes } + dimension: session_data_session_start_time { hidden:yes } + dimension_group: prev_session_end_time { + hidden: yes + type: time + timeframes: [hour,date,week,year,raw] + } + dimension_group: since_previous_session { + view_label: "Audience" + group_label: "User" + type: duration + intervals: [hour,day] + sql_start: ${prev_session_end_time_raw} ;; + sql_end: ${session_data_session_start_time} ;; + } + dimension: days_since_previous_session_tier { + view_label: "Audience" + group_label: "User" + description: "Days since the previous session. 0 if user only has 1 session." + type: tier + style: integer + tiers: [1,2,4,8,15,31,61,121,365] + sql: ${days_since_previous_session};; + } + } diff --git a/views/user_segment.view.lkml b/views/user_segment.view.lkml new file mode 100644 index 0000000..b27d987 --- /dev/null +++ b/views/user_segment.view.lkml @@ -0,0 +1,106 @@ +view: user_segment_filters { + extension: required + filter: user_segment_timeframe { + type: date + } + filter: user_segment_landing_page { + type: string + suggest_explore: sessions + suggest_dimension: sessions.landing_page + } +} + +view: user_segment { + derived_table: { + #https://gafourblock.cloud.looker.com/explore/ga4/sessions?qid=TNJNii9UxKynCJltMZZ0iv&toggle=fil + + explore_source: sessions { + column: user_pseudo_id {} + column: total_sessions {} + column: total_purchase_revenue { field: events.total_purchase_revenue } + column: total_transactions { field: events.total_transactions } + bind_filters: { + from_field: user_segment.user_segment_timeframe + to_field: sessions.session_date #bind filters to filter the table when the view is created + } + bind_filters: { + from_field: user_segment.user_segment_landing_page + to_field: sessions.landing_page + } + + } + } + + extends: [user_segment_filters] + + dimension: user_pseudo_id {hidden:yes primary_key:yes} + dimension: total_sessions { + hidden: yes + label: "Sessions Sessions" + description: "Total Number of Sessions (Count)" + #value_format: "[<1000]0;[<1000000]0.0,"K";0.0,,"M"" + type: number + } + dimension: total_purchase_revenue { + hidden: yes + label: "Events Purchase Revenue" + value_format: "$#,##0.00" + type: number + } + dimension: total_transactions { + hidden: yes + label: "Events Transactions" + type: number + } + + + measure: segment_users { + group_label: "In Selected Timeframe" + type: count_distinct + allow_approximate_optimization: yes + sql: ${user_pseudo_id} ;; + } + + measure: retention_rate { + type: number + sql: ${segment_users}/NULLIF(${sessions.total_users},0) ;; + value_format_name: percent_1 + } + + measure: segment_sessions { + group_label: "In Selected Timeframe" + type: sum + sql: ${total_sessions} ;; + value_format_name: decimal_0 + } + + measure: segment_transaction_revenue { + group_label: "In Selected Timeframe" + type: sum + sql: ${total_purchase_revenue} ;; + value_format_name: usd_0 + } + + measure: segment_transaction_revenue_per_user { + group_label: "In Selected Timeframe" + type: number + sql: ${segment_transaction_revenue}/NULLIF(${segment_users},0) ;; + value_format_name: usd + } + + measure: segment_transaction_count { + group_label: "In Selected Timeframe" + type: sum + sql: ${total_transactions} ;; + value_format_name: decimal_0 + } + + measure: segment_transaction_conversion_rate { + group_label: "In Selected Timeframe" + type: number + sql: ${segment_transaction_count}/NULLIF(${segment_sessions},0) ;; + value_format_name: percent_1 + } + + +}