├── explores ├── .gitkeep ├── advertiser_events.explore.lkml ├── campaign_events.explore.lkml ├── product_events.explore.lkml ├── ad_group_events.explore.lkml └── keyword_events.explore.lkml ├── dashboards ├── .gitkeep ├── product_analytics.dashboard.lookml ├── keyword_performance.dashboard.lookml └── sa360_overview.dashboard.lookml ├── block_sa360_v2.model.lkml ├── manifest.lkml ├── marketplace.json ├── LICENSE ├── views ├── advertiser.view.lkml ├── account.view.lkml ├── floodlight_activity.view.lkml ├── advertiser_events.view.lkml ├── product_events.view.lkml ├── campaign_events.view.lkml ├── advertiser_conversion_events.view.lkml ├── keyword.view.lkml ├── campaign_conversion_events.view.lkml ├── ad_group_conversion_events.view.lkml ├── product_conversion_events.view.lkml ├── keyword_conversion_events.view.lkml ├── ad_group_events.view.lkml ├── ad_group.view.lkml ├── keyword_events.view.lkml ├── campaign.view.lkml └── product.view.lkml └── README.md /explores/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dashboards/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /block_sa360_v2.model.lkml: -------------------------------------------------------------------------------- 1 | connection: "@{CONNECTION_NAME}" 2 | 3 | include: "/dashboards/*.dashboard.lookml" 4 | include: "/explores/*.explore" 5 | 6 | 7 | datagroup: block_sa360_v2_default_datagroup { 8 | # sql_trigger: SELECT MAX(id) FROM etl_log;; 9 | max_cache_age: "1 hour" 10 | } 11 | 12 | persist_with: block_sa360_v2_default_datagroup 13 | -------------------------------------------------------------------------------- /manifest.lkml: -------------------------------------------------------------------------------- 1 | project_name: "block_sa360" 2 | 3 | 4 | constant: CONNECTION_NAME { 5 | value: "input_connection_name" 6 | export: override_optional 7 | } 8 | 9 | constant: SA_360_SCHEMA { 10 | value: "input_schema_here" 11 | export: override_optional 12 | } 13 | 14 | constant: ADVERTISER_ID { 15 | value: "input_advertiser_id" 16 | export: override_optional 17 | } 18 | -------------------------------------------------------------------------------- /marketplace.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Search Ads 360", 3 | "category_label": "Models", 4 | "branding": { 5 | "image_uri": "https://marketplace-api.looker.com/block-icons/sa360.jpg", 6 | "tagline": "A smarter, cleaner way to gather and share insights from your Search Ads 360. (Beta)", 7 | "badge": "Beta" 8 | }, 9 | 10 | "constants": { 11 | "CONNECTION_NAME": { 12 | "label": "Connection Name", 13 | "value_constraint": "connection" 14 | }, 15 | "SA_360_SCHEMA": { 16 | "label": "Search Ads 360 Schema Name" 17 | }, 18 | "ADVERTISER_ID": { 19 | "label": "Advertiser ID from Search Ads 360" 20 | } 21 | }, 22 | "models": [ 23 | { 24 | "name": "block_sa360_v2", 25 | "connection_constant": "CONNECTION_NAME" 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /explores/advertiser_events.explore.lkml: -------------------------------------------------------------------------------- 1 | include: "/views/*.view" 2 | 3 | explore: advertiser_events { 4 | label: "(1) Advertiser Events" 5 | description: "Performance metrics across all of an advertiser's engine accounts and campaigns." 6 | join: advertiser_conversion_events { 7 | view_label: "Advertiser Events" 8 | relationship: one_to_one 9 | type: left_outer 10 | sql_on: ${advertiser_events.advertiser_id} = ${advertiser_conversion_events.advertiser_id} 11 | AND ${advertiser_events._data_date} = ${advertiser_conversion_events._data_date} 12 | AND ${advertiser_events.device_segment} = ${advertiser_conversion_events.device_segment};; 13 | } 14 | # Join Dimensional Tables 15 | join: advertiser { 16 | relationship: one_to_one 17 | type: left_outer 18 | sql_on: ${advertiser.advertiser_composite_key} = ${advertiser_events.advertiser_composite_key} ;; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Google 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /explores/campaign_events.explore.lkml: -------------------------------------------------------------------------------- 1 | include: "/views/*.view" 2 | 3 | explore: campaign_events { 4 | label: "(2) Campaign Events" 5 | description: "Performance metrics for Campaigns." 6 | join: campaign_conversion_events { 7 | view_label: "Campaign Events" 8 | relationship: one_to_one 9 | type: left_outer 10 | sql_on: ${campaign_events.campaign_id} = ${campaign_conversion_events.campaign_id} 11 | AND ${campaign_events._data_date} = ${campaign_conversion_events._data_date} 12 | AND ${campaign_events.device_segment} = ${campaign_conversion_events.device_segment};; 13 | } 14 | join: account { 15 | view_label: "Campaign Events" 16 | relationship: one_to_one 17 | type: left_outer 18 | sql_on: ${campaign_events.account_composite_key} = ${account.account_composite_key} ;; 19 | } 20 | # Join Dimensional Tables 21 | join: campaign { 22 | relationship: one_to_one 23 | type: left_outer 24 | sql_on: ${campaign_events.campaign_composite_key} = ${campaign.campaign_composite_key} ;; 25 | } 26 | join: advertiser { 27 | relationship: one_to_one 28 | type: left_outer 29 | sql_on: ${campaign_events.advertiser_composite_key} = ${advertiser.advertiser_composite_key} ;; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /explores/product_events.explore.lkml: -------------------------------------------------------------------------------- 1 | include: "/views/*.view" 2 | 3 | explore: product_events { 4 | description: "Performance metrics for products defined in an inventory feed and advertised in a shopping campaign." 5 | join: product_conversion_events { 6 | view_label: "Product Events" 7 | relationship: one_to_one 8 | type: left_outer 9 | sql_on: ${product_conversion_events.product_id} = ${product_events.product_id} 10 | AND ${product_conversion_events._data_date} = ${product_events._data_date} 11 | AND ${product_conversion_events.device_segment} = ${product_events.device_segment};; 12 | } 13 | join: account { 14 | view_label: "Product Events" 15 | relationship: one_to_one 16 | type: left_outer 17 | sql_on: ${product_conversion_events.product_composite_key} = ${account.account_composite_key} ;; 18 | } 19 | join: product { 20 | relationship: one_to_one 21 | type: left_outer 22 | sql_on: ${product_conversion_events.product_composite_key} = ${product.product_composite_key} ;; 23 | } 24 | join: advertiser { 25 | relationship: one_to_one 26 | type: left_outer 27 | sql_on: ${product_conversion_events.product_composite_key} = ${advertiser.advertiser_composite_key} ;; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /explores/ad_group_events.explore.lkml: -------------------------------------------------------------------------------- 1 | include: "/views/*.view" 2 | 3 | explore: ad_group_events { 4 | label: "(3) Ad Group Events" 5 | description: "Performance metrics for Ad Groups." 6 | join: ad_group_conversion_events { 7 | view_label: "Ad Group Events" 8 | relationship: one_to_one 9 | type: left_outer 10 | sql_on: ${ad_group_events.ad_group_id} = ${ad_group_conversion_events.ad_group_id} 11 | AND ${ad_group_events._data_date} = ${ad_group_conversion_events._data_date} 12 | AND ${ad_group_events.device_segment} = ${ad_group_conversion_events.device_segment};; 13 | } 14 | join: account { 15 | view_label: "Ad Group Events" 16 | relationship: one_to_one 17 | type: left_outer 18 | sql_on: ${ad_group_events.account_composite_key} = ${account.account_composite_key} ;; 19 | } 20 | # Join Dimensional Tables 21 | join: ad_group { 22 | relationship: one_to_one 23 | type: left_outer 24 | sql_on: ${ad_group_events.ad_group_composite_key} = ${ad_group.ad_group_composite_key} ;; 25 | } 26 | join: campaign { 27 | relationship: one_to_one 28 | type: left_outer 29 | sql_on: ${ad_group_events.campaign_composite_key} = ${campaign.campaign_composite_key} ;; 30 | } 31 | join: advertiser { 32 | relationship: one_to_one 33 | type: left_outer 34 | sql_on: ${ad_group_events.advertiser_composite_key} = ${advertiser.advertiser_composite_key} ;; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /explores/keyword_events.explore.lkml: -------------------------------------------------------------------------------- 1 | include: "/views/*.view" 2 | 3 | explore: keyword_events { 4 | label: "(4) Keyword Events" 5 | description: "Performance metrics for Keywords including Floodlight attributes." 6 | join: keyword_conversion_events { 7 | view_label: "Keyword Events" 8 | relationship: one_to_one 9 | type: full_outer 10 | sql_on: ${keyword_events.keyword_id} = ${keyword_conversion_events.keyword_id} 11 | AND ${keyword_events._data_date} = ${keyword_conversion_events._data_date} 12 | AND ${keyword_events.device_segment} = ${keyword_conversion_events.device_segment} 13 | AND ${keyword_events.ad_id} = ${keyword_conversion_events.ad_id} 14 | AND ${keyword_events.ad_group_id} = ${keyword_conversion_events.ad_group_id};; 15 | } 16 | # Join Dimensional Tables 17 | join: account { 18 | view_label: "Keyword Events" 19 | relationship: one_to_one 20 | type: left_outer 21 | sql_on: ${account.account_composite_key} = ${keyword_events.account_composite_key} ;; 22 | } 23 | join: keyword { 24 | relationship: one_to_one 25 | type: left_outer 26 | sql_on: ${keyword_events.keyword_composite_key} = ${keyword.keyword_composite_key} ;; 27 | } 28 | join: ad_group { 29 | relationship: one_to_one 30 | type: left_outer 31 | sql_on: ${keyword_events.ad_group_composite_key} = ${ad_group.ad_group_composite_key} ;; 32 | } 33 | join: campaign { 34 | relationship: one_to_one 35 | type: left_outer 36 | sql_on: ${keyword_events.campaign_composite_key} = ${campaign.campaign_composite_key} ;; 37 | } 38 | join: advertiser { 39 | relationship: one_to_one 40 | type: left_outer 41 | sql_on: ${keyword_events.advertiser_composite_key} = ${advertiser.advertiser_composite_key} ;; 42 | } 43 | join: floodlight_activity { 44 | relationship: many_to_one 45 | type: left_outer 46 | sql_on: ${keyword_conversion_events.floodlight_activity_id} = ${floodlight_activity.floodlight_activity_id} ;; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /views/advertiser.view.lkml: -------------------------------------------------------------------------------- 1 | view: advertiser { 2 | sql_table_name: `@{SA_360_SCHEMA}.Advertiser_@{ADVERTISER_ID}`;; 3 | 4 | dimension: advertiser_composite_key { 5 | primary_key: yes 6 | hidden: yes 7 | sql: ${advertiser_id} || ' ' || ${_data_date} ;; 8 | } 9 | 10 | dimension_group: _data { 11 | hidden: yes 12 | type: time 13 | timeframes: [ 14 | raw, 15 | date, 16 | week, 17 | month, 18 | quarter, 19 | year 20 | ] 21 | convert_tz: no 22 | datatype: date 23 | sql: ${TABLE}._DATA_DATE ;; 24 | } 25 | 26 | dimension_group: _latest { 27 | hidden: yes 28 | type: time 29 | timeframes: [ 30 | raw, 31 | date, 32 | week, 33 | month, 34 | quarter, 35 | year 36 | ] 37 | convert_tz: no 38 | datatype: date 39 | sql: ${TABLE}._LATEST_DATE ;; 40 | } 41 | 42 | dimension: advertiser { 43 | type: string 44 | sql: ${TABLE}.advertiser ;; 45 | } 46 | 47 | dimension: advertiser_currency_code { 48 | type: string 49 | sql: ${TABLE}.advertiserCurrencyCode ;; 50 | } 51 | 52 | dimension: advertiser_id { 53 | type: string 54 | sql: ${TABLE}.advertiserId ;; 55 | } 56 | 57 | dimension: agency { 58 | type: string 59 | sql: ${TABLE}.agency ;; 60 | } 61 | 62 | dimension: agency_id { 63 | type: string 64 | sql: ${TABLE}.agencyId ;; 65 | } 66 | 67 | dimension_group: creation { 68 | type: time 69 | timeframes: [ 70 | raw, 71 | time, 72 | date, 73 | week, 74 | month, 75 | quarter, 76 | year 77 | ] 78 | sql: ${TABLE}.creationTimestamp ;; 79 | } 80 | 81 | dimension: dfa_advertiser_id { 82 | group_label: "DoubleClick for Advertisers" 83 | type: string 84 | sql: ${TABLE}.dfaAdvertiserId ;; 85 | } 86 | 87 | dimension: dfa_network_id { 88 | group_label: "DoubleClick for Advertisers" 89 | type: string 90 | sql: ${TABLE}.dfaNetworkId ;; 91 | } 92 | 93 | dimension: dfa_network_time_zone { 94 | group_label: "DoubleClick for Advertisers" 95 | type: string 96 | sql: ${TABLE}.dfaNetworkTimeZone ;; 97 | } 98 | 99 | dimension_group: last_modified { 100 | type: time 101 | timeframes: [ 102 | raw, 103 | time, 104 | date, 105 | week, 106 | month, 107 | quarter, 108 | year 109 | ] 110 | sql: ${TABLE}.lastModifiedTimestamp ;; 111 | } 112 | 113 | dimension: status { 114 | type: string 115 | sql: ${TABLE}.status ;; 116 | } 117 | 118 | measure: count { 119 | hidden: yes 120 | type: count 121 | drill_fields: [] 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /views/account.view.lkml: -------------------------------------------------------------------------------- 1 | view: account { 2 | sql_table_name: `@{SA_360_SCHEMA}.Account_@{ADVERTISER_ID}`;; 3 | 4 | dimension: account_composite_key { 5 | primary_key: yes 6 | hidden: yes 7 | sql: ${account_id} || ' ' || ${_data_date} ;; 8 | } 9 | 10 | dimension_group: _data { 11 | hidden: yes 12 | type: time 13 | timeframes: [ 14 | raw, 15 | date, 16 | week, 17 | month, 18 | quarter, 19 | year 20 | ] 21 | convert_tz: no 22 | datatype: date 23 | sql: ${TABLE}._DATA_DATE ;; 24 | } 25 | 26 | dimension_group: _latest { 27 | hidden: yes 28 | type: time 29 | timeframes: [ 30 | raw, 31 | date, 32 | week, 33 | month, 34 | quarter, 35 | year 36 | ] 37 | convert_tz: no 38 | datatype: date 39 | sql: ${TABLE}._LATEST_DATE ;; 40 | } 41 | 42 | dimension: account { 43 | hidden: yes 44 | type: string 45 | sql: ${TABLE}.account ;; 46 | } 47 | 48 | dimension: account_currency_code { 49 | hidden: yes 50 | type: string 51 | sql: ${TABLE}.accountCurrencyCode ;; 52 | } 53 | 54 | dimension: account_engine_id { 55 | hidden: yes 56 | type: string 57 | sql: ${TABLE}.accountEngineId ;; 58 | } 59 | 60 | dimension: account_id { 61 | hidden: yes 62 | type: string 63 | sql: ${TABLE}.accountId ;; 64 | } 65 | 66 | dimension: account_time_zone { 67 | hidden: yes 68 | type: string 69 | sql: ${TABLE}.accountTimeZone ;; 70 | } 71 | 72 | dimension: account_type { 73 | label: "Engine Account" 74 | description: "Platform the Ad was shown on: Google AdWords, Bing Ads, Yahoo Japan Listing Ads, Yahoo Search Marketing, Yahoo Gemini, Baidu, or Comparison Shopping." 75 | type: string 76 | sql: ${TABLE}.accountType ;; 77 | } 78 | 79 | dimension: advertiser_id { 80 | hidden: yes 81 | type: string 82 | sql: ${TABLE}.advertiserId ;; 83 | } 84 | 85 | dimension: agency_id { 86 | hidden: yes 87 | type: string 88 | sql: ${TABLE}.agencyId ;; 89 | } 90 | 91 | dimension_group: creation_timestamp { 92 | hidden: yes 93 | type: time 94 | timeframes: [ 95 | raw, 96 | time, 97 | date, 98 | week, 99 | month, 100 | quarter, 101 | year 102 | ] 103 | sql: ${TABLE}.creationTimestamp ;; 104 | } 105 | 106 | dimension_group: last_modified_timestamp { 107 | hidden: yes 108 | type: time 109 | timeframes: [ 110 | raw, 111 | time, 112 | date, 113 | week, 114 | month, 115 | quarter, 116 | year 117 | ] 118 | sql: ${TABLE}.lastModifiedTimestamp ;; 119 | } 120 | 121 | dimension: status { 122 | hidden: yes 123 | type: string 124 | sql: ${TABLE}.status ;; 125 | } 126 | 127 | } 128 | -------------------------------------------------------------------------------- /views/floodlight_activity.view.lkml: -------------------------------------------------------------------------------- 1 | view: floodlight_activity { 2 | sql_table_name: `@{SA_360_SCHEMA}.FloodlightActivity_@{ADVERTISER_ID}`;; 3 | 4 | dimension_group: _data { 5 | hidden: yes 6 | type: time 7 | timeframes: [ 8 | raw, 9 | date, 10 | week, 11 | month, 12 | quarter, 13 | year 14 | ] 15 | convert_tz: no 16 | datatype: date 17 | sql: ${TABLE}._DATA_DATE ;; 18 | } 19 | 20 | dimension_group: _latest { 21 | hidden: yes 22 | type: time 23 | timeframes: [ 24 | raw, 25 | date, 26 | week, 27 | month, 28 | quarter, 29 | year 30 | ] 31 | convert_tz: no 32 | datatype: date 33 | sql: ${TABLE}._LATEST_DATE ;; 34 | } 35 | 36 | dimension: advertiser_id { 37 | hidden: yes 38 | type: string 39 | sql: ${TABLE}.advertiserId ;; 40 | } 41 | 42 | dimension: agency_id { 43 | hidden: yes 44 | type: string 45 | sql: ${TABLE}.agencyId ;; 46 | } 47 | 48 | dimension_group: creation_timestamp { 49 | hidden: yes 50 | type: time 51 | timeframes: [ 52 | raw, 53 | time, 54 | date, 55 | week, 56 | month, 57 | quarter, 58 | year 59 | ] 60 | sql: ${TABLE}.creationTimestamp ;; 61 | } 62 | 63 | dimension: floodlight_activity { 64 | type: string 65 | sql: ${TABLE}.floodlightActivity ;; 66 | } 67 | 68 | dimension: floodlight_activity_id { 69 | hidden: yes 70 | type: string 71 | sql: ${TABLE}.floodlightActivityId ;; 72 | } 73 | 74 | dimension: floodlight_activity_tag { 75 | type: string 76 | sql: ${TABLE}.floodlightActivityTag ;; 77 | } 78 | 79 | dimension: floodlight_configuration_id { 80 | description: "Campaign manager Floodlight configuration ID." 81 | type: string 82 | sql: ${TABLE}.floodlightConfigurationId ;; 83 | } 84 | 85 | dimension: floodlight_group { 86 | type: string 87 | sql: ${TABLE}.floodlightGroup ;; 88 | } 89 | 90 | dimension: floodlight_group_conversion_type { 91 | description: "The type of conversions generated by Floodlight activities in this group: Action or Transaction." 92 | type: string 93 | sql: ${TABLE}.floodlightGroupConversionType ;; 94 | } 95 | 96 | dimension: floodlight_group_id { 97 | type: string 98 | sql: ${TABLE}.floodlightGroupId ;; 99 | } 100 | 101 | dimension: floodlight_group_tag { 102 | type: string 103 | sql: ${TABLE}.floodlightGroupTag ;; 104 | } 105 | 106 | dimension_group: last_modified { 107 | type: time 108 | timeframes: [ 109 | raw, 110 | time, 111 | date, 112 | week, 113 | month, 114 | quarter, 115 | year 116 | ] 117 | sql: ${TABLE}.lastModifiedTimestamp ;; 118 | } 119 | 120 | dimension: status { 121 | type: string 122 | sql: ${TABLE}.status ;; 123 | } 124 | 125 | measure: count { 126 | hidden: yes 127 | type: count 128 | drill_fields: [] 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /views/advertiser_events.view.lkml: -------------------------------------------------------------------------------- 1 | view: advertiser_events { 2 | sql_table_name: `@{SA_360_SCHEMA}.AdvertiserDeviceStats_@{ADVERTISER_ID}` ;; 3 | 4 | dimension: advertiser_composite_key { 5 | hidden: yes 6 | sql: ${advertiser_id} || ' ' || ${_data_date} ;; 7 | } 8 | 9 | 10 | dimension_group: _data { 11 | type: time 12 | timeframes: [ 13 | raw, 14 | date, 15 | week, 16 | month, 17 | quarter, 18 | year 19 | ] 20 | convert_tz: no 21 | datatype: date 22 | sql: ${TABLE}._DATA_DATE ;; 23 | } 24 | 25 | dimension_group: _latest { 26 | hidden: yes 27 | type: time 28 | timeframes: [ 29 | raw, 30 | date, 31 | week, 32 | month, 33 | quarter, 34 | year 35 | ] 36 | convert_tz: no 37 | datatype: date 38 | sql: ${TABLE}._LATEST_DATE ;; 39 | } 40 | 41 | dimension: ad_words_conversion_value { 42 | type: number 43 | sql: ${TABLE}.adWordsConversionValue ;; 44 | } 45 | 46 | dimension: ad_words_conversions { 47 | type: number 48 | sql: ${TABLE}.adWordsConversions ;; 49 | } 50 | 51 | dimension: ad_words_view_through_conversions { 52 | type: number 53 | sql: ${TABLE}.adWordsViewThroughConversions ;; 54 | } 55 | 56 | dimension: advertiser_id { 57 | hidden: yes 58 | type: string 59 | sql: ${TABLE}.advertiserId ;; 60 | } 61 | 62 | dimension: agency_id { 63 | hidden: yes 64 | type: string 65 | sql: ${TABLE}.agencyId ;; 66 | } 67 | 68 | dimension: avg_cpc { 69 | hidden: yes 70 | type: number 71 | sql: ${TABLE}.avgCpc ;; 72 | } 73 | 74 | dimension: avg_cpm { 75 | hidden: yes 76 | type: number 77 | sql: ${TABLE}.avgCpm ;; 78 | } 79 | 80 | dimension: avg_pos { 81 | hidden: yes 82 | type: number 83 | sql: ${TABLE}.avgPos ;; 84 | } 85 | 86 | dimension: clicks { 87 | hidden: yes 88 | type: number 89 | sql: ${TABLE}.clicks ;; 90 | } 91 | 92 | dimension: cost { 93 | hidden: yes 94 | type: number 95 | sql: ${TABLE}.cost ;; 96 | } 97 | 98 | dimension: ctr { 99 | hidden: yes 100 | type: number 101 | sql: ${TABLE}.ctr ;; 102 | } 103 | 104 | dimension_group: date { 105 | hidden: yes 106 | type: time 107 | timeframes: [ 108 | raw, 109 | date, 110 | week, 111 | month, 112 | quarter, 113 | year 114 | ] 115 | convert_tz: no 116 | datatype: date 117 | sql: ${TABLE}.date ;; 118 | } 119 | 120 | dimension: device_segment { 121 | hidden: yes 122 | type: string 123 | sql: ${TABLE}.deviceSegment ;; 124 | } 125 | 126 | dimension: dfa_advertiser_id { 127 | hidden: yes 128 | type: string 129 | sql: ${TABLE}.dfaAdvertiserId ;; 130 | } 131 | 132 | dimension: dfa_network_id { 133 | hidden: yes 134 | type: string 135 | sql: ${TABLE}.dfaNetworkId ;; 136 | } 137 | 138 | dimension: impr { 139 | hidden: yes 140 | type: number 141 | sql: ${TABLE}.impr ;; 142 | } 143 | 144 | dimension: visits { 145 | hidden: yes 146 | type: number 147 | sql: ${TABLE}.visits ;; 148 | } 149 | 150 | ##### Ad Event Metrics ##### 151 | 152 | measure: total_impressions { 153 | type: sum 154 | sql: ${impr} ;; 155 | value_format:"[<1000]0.00;[<1000000]0.00,\" K\";0.00,,\" M\"" 156 | } 157 | 158 | measure: total_clicks { 159 | type: sum 160 | sql: ${clicks} ;; 161 | value_format:"[<1000]0.00;[<1000000]0.00,\" K\";0.00,,\" M\"" 162 | } 163 | 164 | measure: total_visits { 165 | type: sum 166 | sql: ${visits} ;; 167 | } 168 | 169 | measure: total_cost { 170 | label: "Total Spend (Search Clicks)" 171 | type: sum 172 | value_format_name: usd_0 173 | sql: ${cost} ;; 174 | } 175 | 176 | measure: total_cumulative_spend { 177 | label: "Total Spend (Cumulative)" 178 | type: running_total 179 | sql: ${total_cost} ;; 180 | value_format_name: usd_0 181 | 182 | } 183 | 184 | measure: click_through_rate { 185 | label: "Click Through Rate (CTR)" 186 | description: "Percent of people that click on an ad." 187 | type: number 188 | value_format_name: percent_2 189 | sql: ${total_clicks}*1.0/NULLIF(${total_impressions},0);; 190 | } 191 | 192 | measure: cost_per_click { 193 | label: "Cost per Click (CPC)" 194 | description: "Average cost per ad click." 195 | type: number 196 | sql: ${total_cost}* 1.0/ NULLIF(${total_clicks},0) ;; 197 | value_format_name: usd 198 | } 199 | 200 | 201 | } 202 | -------------------------------------------------------------------------------- /views/product_events.view.lkml: -------------------------------------------------------------------------------- 1 | view: product_events { 2 | sql_table_name: `@{SA_360_SCHEMA}.ProductAdvertisedDeviceStats_@{ADVERTISER_ID}`;; 3 | 4 | dimension_group: _data { 5 | type: time 6 | timeframes: [ 7 | raw, 8 | date, 9 | week, 10 | month, 11 | quarter, 12 | year 13 | ] 14 | convert_tz: no 15 | datatype: date 16 | sql: ${TABLE}._DATA_DATE ;; 17 | } 18 | 19 | dimension_group: _latest { 20 | hidden: yes 21 | type: time 22 | timeframes: [ 23 | raw, 24 | date, 25 | week, 26 | month, 27 | quarter, 28 | year 29 | ] 30 | convert_tz: no 31 | datatype: date 32 | sql: ${TABLE}._LATEST_DATE ;; 33 | } 34 | 35 | dimension: ad_words_conversion_value { 36 | hidden: yes 37 | type: number 38 | sql: ${TABLE}.adWordsConversionValue ;; 39 | } 40 | 41 | dimension: ad_words_conversions { 42 | hidden: yes 43 | type: number 44 | sql: ${TABLE}.adWordsConversions ;; 45 | } 46 | 47 | dimension: ad_words_view_through_conversions { 48 | hidden: yes 49 | type: number 50 | sql: ${TABLE}.adWordsViewThroughConversions ;; 51 | } 52 | 53 | dimension: advertiser_id { 54 | hidden: yes 55 | type: string 56 | sql: ${TABLE}.advertiserId ;; 57 | } 58 | 59 | dimension: agency_id { 60 | hidden: yes 61 | type: string 62 | sql: ${TABLE}.agencyId ;; 63 | } 64 | 65 | dimension: avg_cpc { 66 | hidden: yes 67 | type: number 68 | sql: ${TABLE}.avgCpc ;; 69 | } 70 | 71 | dimension: avg_cpm { 72 | hidden: yes 73 | type: number 74 | sql: ${TABLE}.avgCpm ;; 75 | } 76 | 77 | dimension: avg_pos { 78 | hidden: yes 79 | type: number 80 | sql: ${TABLE}.avgPos ;; 81 | } 82 | 83 | dimension: clicks { 84 | hidden: yes 85 | type: number 86 | sql: ${TABLE}.clicks ;; 87 | } 88 | 89 | dimension: cost { 90 | hidden: yes 91 | type: number 92 | sql: ${TABLE}.cost ;; 93 | } 94 | 95 | dimension: ctr { 96 | hidden: yes 97 | type: number 98 | sql: ${TABLE}.ctr ;; 99 | } 100 | 101 | dimension_group: date { 102 | hidden: yes 103 | type: time 104 | timeframes: [ 105 | raw, 106 | date, 107 | week, 108 | month, 109 | quarter, 110 | year 111 | ] 112 | convert_tz: no 113 | datatype: date 114 | sql: ${TABLE}.date ;; 115 | } 116 | 117 | dimension: device_segment { 118 | hidden: yes 119 | type: string 120 | sql: ${TABLE}.deviceSegment ;; 121 | } 122 | 123 | dimension: impr { 124 | hidden: yes 125 | type: number 126 | sql: ${TABLE}.impr ;; 127 | } 128 | 129 | dimension: product_id { 130 | hidden: yes 131 | type: string 132 | sql: ${TABLE}.productId ;; 133 | } 134 | 135 | dimension: visits { 136 | hidden: yes 137 | type: number 138 | sql: ${TABLE}.visits ;; 139 | } 140 | 141 | measure: count { 142 | hidden: yes 143 | type: count 144 | drill_fields: [] 145 | } 146 | 147 | ##### Product Metrics ##### 148 | 149 | measure: total_impressions { 150 | type: sum 151 | sql: ${impr} ;; 152 | drill_fields: [campaign.campaign, total_impressions, total_clicks] 153 | value_format:"[<1000]0.00;[<1000000]0.00,\" K\";0.00,,\" M\"" 154 | } 155 | 156 | measure: total_clicks { 157 | type: sum 158 | sql: ${clicks} ;; 159 | drill_fields: [campaign.campaign, total_clicks, product_conversion_events.total_conversions] 160 | value_format:"[<1000]0.00;[<1000000]0.00,\" K\";0.00,,\" M\"" 161 | } 162 | 163 | measure: total_visits { 164 | type: sum 165 | sql: ${visits} ;; 166 | } 167 | 168 | measure: total_cost { 169 | label: "Total Spend (Search Clicks)" 170 | type: sum 171 | value_format_name: usd 172 | sql: ${cost} ;; 173 | drill_fields: [campaign.campaign, total_cost, product_conversion_events.total_revenue, product_conversion_events.ROAS] 174 | } 175 | 176 | measure: total_cumulative_spend { 177 | label: "Total Spend (Cumulative)" 178 | type: running_total 179 | sql: ${total_cost} ;; 180 | value_format_name: usd_0 181 | 182 | } 183 | 184 | measure: click_through_rate { 185 | label: "Click Through Rate (CTR)" 186 | description: "Percent of people that click on an ad." 187 | type: number 188 | value_format_name: percent_2 189 | sql: ${total_clicks}*1.0/NULLIF(${total_impressions},0);; 190 | drill_fields: [campaign.campaign, click_through_rate, total_clicks, total_impressions] 191 | } 192 | 193 | measure: cost_per_click { 194 | label: "Cost per Click (CPC)" 195 | description: "Average cost per ad click." 196 | type: number 197 | sql: ${total_cost}* 1.0/ NULLIF(${total_clicks},0) ;; 198 | value_format_name: usd 199 | drill_fields: [campaign.campaign, cost_per_click, total_cost, total_clicks] 200 | } 201 | } 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # What does this Looker Block do for me? 2 | - Quickly understand the state of your search ad campaigns across all engines with the SA360 Overview. Slice metrics like cost per acquisition and click through rate by variables like engine, advertiser, campaign and keyword. 3 | 4 | - Go deep on the details of any campaign from the Campaign Performance Dashboard. Understand the trends over time for an individual campaign’s performance based on the metrics that matter to you across all engines driving the campaign. Seamlessly switch between your Goal Metric and compare performance between customizable time periods. 5 | 6 | - Understand the performance of individual keywords with the Keyword Performance Dashboard. Analyze your profitability overtime to optimize your spend strategy and increase revenue. With the ability to compare keyword performance between two periods of your choosing, you can determine how modifications in strategy have impacted keyword performance pre- and post-change. Whether you care about clicks, conversions, CPA or ROAS, Looker provides the ability to easily toggle between metrics so that you can analyze keyword performance curated around what matters most to your business. 7 | 8 | - Compare Product performance with the Product Analytics Dashboard. Quickly understand which products are your highest earners to optimize your spend and increase ROI. Furthermore, understand how individual or groups of products are performing across a variety of KPIs; from clicks to click through rate, conversions to cost per acquisition. 9 | 10 | - Enterprise Data Platform - Take advantage of Looker's data platform functionality, including data actions, scheduling, permissions, alerting, parameterization (each user can only see their own data), and more. 11 | 12 | - Usable / Shareable Dashboards - create centralized dashboards for the entire team, and departmental or individual dashboards for each user, and rest easy knowing everyone is looking at the same information at all times. Then schedule the dashboard for emails or alerts, campaign-end reporting, or whatever else serves your use-case. 13 | 14 | ## Search Ads 360 Data Structure 15 | 16 | 17 | - Prior to installing the block, you will need to use the BigQuery Data Transfer Service to load your data into BigQuery. The BigQuery Data Transfer Service for Search Ads 360 (formerly known as Doubleclick Search) allows you to automatically schedule and manage recurring load jobs for Search Ads 360 reporting data. More details can be found [here](https://slack-redir.net/link?url=https%3A%2F%2Fcloud.google.com%2Fbigquery-transfer%2Fdocs%2Fsa360-transfer). 18 | 19 | - This block was built off of BigQuery Views; virtual tables that expose aggregated data by day. When your Search Ads 360 (SA360) data is exported (in this case, through Transfer Services), the service also provides corresponding ingestion-time partitioned tables, denoted with the prefix *p_*. If you would rather have the block build off the partitioned tables, please change the ingested tables with the prefix *p_* in the LookML. The schema of the tables is nearly identical, but you will need to make addments to the two dimensions: changing *_data* to *_partitiontime* and *_latest* to *_current*, as seen in the code below. 20 | -- *${TABLE}._DATA_DATE* -> *${TABLE}._PARTITIONTIME* 21 | -- *${TABLE}._LATEST_DATE* -> *${TABLE}._CURRENT_DATE* 22 | 23 | - Google's documentation on the data included in the export can be found [here](https://cloud.google.com/bigquery-transfer/docs/sa360-transformation). 24 | - You can also find a cookbook of SQL queries for common questions in Google's documentation. 25 | 26 | 27 | ## Block Structure 28 | This block uses refinements for customization. For more information on using refinements to customize marketplace blocks, please see [this link](https://docs.looker.com/data-modeling/marketplace/customize-blocks#marketplace_blocks_that_use_refinements). 29 | 30 | Each explore within this block contains a similar structure. 31 | Highest in the hierarchy with the most aggregated data is 32 | -- Advertiser Events, containing a dimensional view for advertiser information and joined event views for advertiser-level event metrics. 33 | - Second in the hierarchy is Campaign Events, containing Advertiser and Campaign dimensional views and joined event views for campaign-level event metrics. 34 | -- Third in the hierarchy is Ad Group Events, containing Advertiser, Campaign and Ad Group dimensional views, as well as joined event views for ad group-level event metrics. 35 | -- Lowest in the hierarchy and most granular is (4) Keyword Events, containing an Advertiser, Campaign, Ad Group and Keyword dimensional views, as well as joined event views for keyword-level event metrics. This explore additionally contains Floodlight Activity data. 36 | Tangentially, the last explore is Product Events, containing Advertiser and Product dimensional views, as well as joined event views for product-level event metrics. 37 | 38 | ## Notes and Other Known Issues 39 | Be prepared with your advertiser ID prior to installing. Upon installation, you will be prompted to specify the ID. The value for advertiser ID is your Search Ads 360 Advertiser ID. 40 | -------------------------------------------------------------------------------- /views/campaign_events.view.lkml: -------------------------------------------------------------------------------- 1 | view: campaign_events { 2 | sql_table_name: `@{SA_360_SCHEMA}.CampaignDeviceStats_@{ADVERTISER_ID}`;; 3 | 4 | dimension: campaign_composite_key { 5 | hidden: yes 6 | sql: ${campaign_id} || ' ' || ${_data_date} ;; 7 | } 8 | 9 | dimension: advertiser_composite_key { 10 | hidden: yes 11 | sql: ${advertiser_id} || ' ' || ${_data_date} ;; 12 | } 13 | 14 | dimension: account_composite_key { 15 | hidden: yes 16 | sql: ${account_id} || ' ' || ${_data_date} ;; 17 | } 18 | 19 | dimension_group: _data { 20 | type: time 21 | timeframes: [ 22 | raw, 23 | date, 24 | week, 25 | month, 26 | quarter, 27 | year 28 | ] 29 | convert_tz: no 30 | datatype: date 31 | sql: ${TABLE}._DATA_DATE ;; 32 | } 33 | 34 | dimension_group: _latest { 35 | hidden: yes 36 | type: time 37 | timeframes: [ 38 | raw, 39 | date, 40 | week, 41 | month, 42 | quarter, 43 | year 44 | ] 45 | convert_tz: no 46 | datatype: date 47 | sql: ${TABLE}._LATEST_DATE ;; 48 | } 49 | 50 | dimension: account_id { 51 | hidden: yes 52 | type: string 53 | sql: ${TABLE}.accountId ;; 54 | } 55 | 56 | dimension: ad_words_conversion_value { 57 | hidden: yes 58 | type: number 59 | sql: ${TABLE}.adWordsConversionValue ;; 60 | } 61 | 62 | dimension: ad_words_conversions { 63 | hidden: yes 64 | type: number 65 | sql: ${TABLE}.adWordsConversions ;; 66 | } 67 | 68 | dimension: ad_words_view_through_conversions { 69 | hidden: yes 70 | type: number 71 | sql: ${TABLE}.adWordsViewThroughConversions ;; 72 | } 73 | 74 | dimension: advertiser_id { 75 | hidden: yes 76 | type: string 77 | sql: ${TABLE}.advertiserId ;; 78 | } 79 | 80 | dimension: agency_id { 81 | hidden: yes 82 | type: string 83 | sql: ${TABLE}.agencyId ;; 84 | } 85 | 86 | dimension: avg_cpc { 87 | hidden: yes 88 | type: number 89 | sql: ${TABLE}.avgCpc ;; 90 | } 91 | 92 | dimension: avg_cpm { 93 | hidden: yes 94 | type: number 95 | sql: ${TABLE}.avgCpm ;; 96 | } 97 | 98 | dimension: avg_pos { 99 | hidden: yes 100 | type: number 101 | sql: ${TABLE}.avgPos ;; 102 | } 103 | 104 | dimension: campaign_engine_id { 105 | hidden: yes 106 | type: string 107 | sql: ${TABLE}.campaignEngineId ;; 108 | } 109 | 110 | dimension: campaign_id { 111 | hidden: yes 112 | type: string 113 | sql: ${TABLE}.campaignId ;; 114 | } 115 | 116 | dimension: clicks { 117 | hidden: yes 118 | type: number 119 | sql: ${TABLE}.clicks ;; 120 | } 121 | 122 | dimension: cost { 123 | hidden: yes 124 | type: number 125 | sql: ${TABLE}.cost ;; 126 | } 127 | 128 | dimension: ctr { 129 | hidden: yes 130 | type: number 131 | sql: ${TABLE}.ctr ;; 132 | } 133 | 134 | dimension_group: date { 135 | hidden: yes 136 | type: time 137 | timeframes: [ 138 | raw, 139 | date, 140 | week, 141 | month, 142 | quarter, 143 | year 144 | ] 145 | convert_tz: no 146 | datatype: date 147 | sql: ${TABLE}.date ;; 148 | } 149 | 150 | dimension: device_segment { 151 | hidden: yes 152 | type: string 153 | sql: ${TABLE}.deviceSegment ;; 154 | } 155 | 156 | dimension: effective_bid_strategy_id { 157 | hidden: yes 158 | type: string 159 | sql: ${TABLE}.effectiveBidStrategyId ;; 160 | } 161 | 162 | dimension: impr { 163 | hidden: yes 164 | type: number 165 | sql: ${TABLE}.impr ;; 166 | } 167 | 168 | dimension: visits { 169 | hidden: yes 170 | type: number 171 | sql: ${TABLE}.visits ;; 172 | } 173 | 174 | ##### Campaign Metrics ##### 175 | 176 | measure: total_impressions { 177 | type: sum 178 | sql: ${impr} ;; 179 | drill_fields: [campaign.campaign, total_impressions, total_clicks] 180 | value_format:"[<1000]0.00;[<1000000]0.00,\" K\";0.00,,\" M\"" 181 | } 182 | 183 | measure: total_clicks { 184 | type: sum 185 | sql: ${clicks} ;; 186 | drill_fields: [campaign.campaign, total_clicks, campaign_conversion_events.total_conversions] 187 | value_format:"[<1000]0.00;[<1000000]0.00,\" K\";0.00,,\" M\"" 188 | } 189 | 190 | measure: total_visits { 191 | type: sum 192 | sql: ${visits} ;; 193 | } 194 | 195 | measure: total_cost { 196 | label: "Total Spend (Search Clicks)" 197 | type: sum 198 | value_format_name: usd_0 199 | sql: ${cost} ;; 200 | drill_fields: [campaign.campaign, total_cost, total_clicks, campaign_conversion_events.total_revenue] 201 | } 202 | 203 | measure: total_cumulative_spend { 204 | label: "Total Spend (Cumulative)" 205 | type: running_total 206 | sql: ${total_cost} ;; 207 | value_format_name: usd_0 208 | 209 | } 210 | 211 | measure: click_through_rate { 212 | label: "Click Through Rate (CTR)" 213 | description: "Percent of people that click on an ad." 214 | type: number 215 | value_format_name: percent_2 216 | sql: ${total_clicks}*1.0/NULLIF(${total_impressions},0);; 217 | drill_fields: [campaign.campaign, click_through_rate, total_clicks, total_impressions] 218 | } 219 | 220 | measure: cost_per_click { 221 | label: "Cost per Click (CPC)" 222 | description: "Average cost per ad click." 223 | type: number 224 | sql: ${total_cost}* 1.0/ NULLIF(${total_clicks},0) ;; 225 | value_format_name: usd 226 | drill_fields: [campaign.campaign, cost_per_click, total_cost, total_clicks] 227 | } 228 | 229 | 230 | } 231 | -------------------------------------------------------------------------------- /views/advertiser_conversion_events.view.lkml: -------------------------------------------------------------------------------- 1 | view: advertiser_conversion_events { 2 | view_label: "Advertiser Events" 3 | sql_table_name: `@{SA_360_SCHEMA}.AdvertiserFloodlightAndDeviceStats_@{ADVERTISER_ID}`;; 4 | 5 | dimension_group: _data { 6 | type: time 7 | timeframes: [ 8 | raw, 9 | date, 10 | week, 11 | month, 12 | quarter, 13 | year 14 | ] 15 | convert_tz: no 16 | datatype: date 17 | sql: ${TABLE}._DATA_DATE ;; 18 | } 19 | 20 | dimension_group: _latest { 21 | hidden: yes 22 | type: time 23 | timeframes: [ 24 | raw, 25 | date, 26 | week, 27 | month, 28 | quarter, 29 | year 30 | ] 31 | convert_tz: no 32 | datatype: date 33 | sql: ${TABLE}._LATEST_DATE ;; 34 | } 35 | 36 | dimension: advertiser_id { 37 | hidden: yes 38 | type: string 39 | sql: ${TABLE}.advertiserId ;; 40 | } 41 | 42 | dimension: agency_id { 43 | hidden: yes 44 | type: string 45 | sql: ${TABLE}.agencyId ;; 46 | } 47 | 48 | dimension_group: date { 49 | hidden: yes 50 | type: time 51 | timeframes: [ 52 | raw, 53 | date, 54 | week, 55 | month, 56 | quarter, 57 | year 58 | ] 59 | convert_tz: no 60 | datatype: date 61 | sql: ${TABLE}.date ;; 62 | } 63 | 64 | dimension: device_segment { 65 | type: string 66 | sql: ${TABLE}.deviceSegment ;; 67 | } 68 | 69 | dimension: dfa_actions { 70 | hidden: yes 71 | type: number 72 | sql: ${TABLE}.dfaActions ;; 73 | } 74 | 75 | dimension: dfa_advertiser_id { 76 | hidden: yes 77 | type: string 78 | sql: ${TABLE}.dfaAdvertiserId ;; 79 | } 80 | 81 | dimension: dfa_network_id { 82 | hidden: yes 83 | type: string 84 | sql: ${TABLE}.dfaNetworkId ;; 85 | } 86 | 87 | dimension: dfa_revenue { 88 | hidden: yes 89 | type: number 90 | sql: ${TABLE}.dfaRevenue ;; 91 | } 92 | 93 | dimension: dfa_transactions { 94 | hidden: yes 95 | type: number 96 | sql: ${TABLE}.dfaTransactions ;; 97 | } 98 | 99 | dimension: dfa_weighted_actions { 100 | hidden: yes 101 | type: number 102 | sql: ${TABLE}.dfaWeightedActions ;; 103 | } 104 | 105 | dimension: floodlight_activity_id { 106 | hidden: yes 107 | type: string 108 | sql: ${TABLE}.floodlightActivityId ;; 109 | } 110 | 111 | dimension: floodlight_group_id { 112 | hidden: yes 113 | type: string 114 | sql: ${TABLE}.floodlightGroupId ;; 115 | } 116 | 117 | ##### Advertiser Standard Metric Aggregates ##### 118 | 119 | measure: total_actions { 120 | type: sum 121 | sql: ${dfa_actions} ;; 122 | } 123 | 124 | measure: total_transactions { 125 | type: sum 126 | sql: ${dfa_transactions} ;; 127 | } 128 | 129 | measure: total_conversions { 130 | description: "Sum of Dfa Actions and Dfa Transactions" 131 | type: number 132 | sql: ${total_actions} + ${total_transactions} ;; 133 | value_format:"[<1000]0.00;[<1000000]0.00,\" K\";0.00,,\" M\"" 134 | } 135 | 136 | ##### Keyword Conversion Metrics ##### 137 | 138 | measure: total_revenue { 139 | type: sum 140 | value_format_name: usd_0 141 | sql: ${dfa_revenue} ;; 142 | } 143 | 144 | measure: ROAS { 145 | description: "Associated revenue divided by the total cost" 146 | type: number 147 | value_format_name: percent_0 148 | sql: 1.0 * ${total_revenue} / NULLIF(${advertiser_events.total_cost},0) ;; 149 | } 150 | 151 | measure: cost_per_acquisition { 152 | label: "Cost per Acquisition (CPA)" 153 | description: "Average cost per conversion" 154 | type: number 155 | value_format_name: usd 156 | sql: ${advertiser_events.total_cost}*1.0/NULLIF(${total_conversions},0) ;; 157 | } 158 | 159 | measure: conversion_rate { 160 | description: "Conversions divided by Clicks" 161 | type: number 162 | value_format_name: percent_2 163 | sql: 1.0 * ${total_conversions} / NULLIF(${advertiser_events.total_clicks},0) ;; 164 | 165 | } 166 | 167 | ###################### Period over Period Reporting Metrics ###################### 168 | 169 | filter: this_period_filter { 170 | view_label: "Period over Period" 171 | group_label: "Arbitrary Period Comparisons" 172 | type: date 173 | } 174 | 175 | filter: prior_period_filter { 176 | view_label: "Period over Period" 177 | group_label: "Arbitrary Period Comparisons" 178 | type: date 179 | } 180 | 181 | dimension: days_from_start_first { 182 | view_label: "Period over Period" 183 | hidden: yes 184 | type: number 185 | sql: DATE_DIFF( ${_data_raw}, CAST({% date_start this_period_filter %} AS DATE), DAY) ;; 186 | } 187 | 188 | dimension: days_from_start_second { 189 | view_label: "Period over Period" 190 | hidden: yes 191 | type: number 192 | sql: DATE_DIFF(${_data_raw}, CAST({% date_start prior_period_filter %} AS DATE), DAY) ;; 193 | } 194 | 195 | dimension: days_from_period_start { 196 | view_label: "Period over Period" 197 | type: number 198 | sql: 199 | CASE 200 | WHEN ${days_from_start_first} >= 0 201 | THEN ${days_from_start_first} 202 | WHEN ${days_from_start_second} >= 0 203 | THEN ${days_from_start_second} 204 | END;; 205 | } 206 | 207 | dimension: period_selected { 208 | view_label: "Period over Period" 209 | type: string 210 | sql: 211 | CASE 212 | WHEN ${_data_raw} >= DATE({% date_start this_period_filter %}) 213 | AND ${_data_raw} <= DATE({% date_end this_period_filter %}) 214 | THEN 'This Period' 215 | WHEN ${_data_raw} >= DATE({% date_start prior_period_filter %}) 216 | AND ${_data_raw} <= DATE({% date_end prior_period_filter %}) 217 | THEN 'Prior Period' 218 | END ;; 219 | } 220 | ###################### Close - Period over Period Reporting Metrics ###################### 221 | } 222 | -------------------------------------------------------------------------------- /views/keyword.view.lkml: -------------------------------------------------------------------------------- 1 | view: keyword { 2 | sql_table_name: `@{SA_360_SCHEMA}.Keyword_@{ADVERTISER_ID}` 3 | ;; 4 | 5 | dimension: keyword_composite_key { 6 | primary_key: yes 7 | sql: ${keyword_id} || ' ' || ${_data_date} ;; 8 | } 9 | 10 | dimension_group: _data { 11 | type: time 12 | timeframes: [ 13 | raw, 14 | date, 15 | week, 16 | month, 17 | quarter, 18 | year 19 | ] 20 | convert_tz: no 21 | datatype: date 22 | sql: ${TABLE}._DATA_DATE ;; 23 | } 24 | 25 | dimension_group: _latest { 26 | hidden: yes 27 | type: time 28 | timeframes: [ 29 | raw, 30 | date, 31 | week, 32 | month, 33 | quarter, 34 | year 35 | ] 36 | convert_tz: no 37 | datatype: date 38 | sql: ${TABLE}._LATEST_DATE ;; 39 | } 40 | 41 | dimension: account_id { 42 | type: string 43 | sql: ${TABLE}.accountId ;; 44 | } 45 | 46 | dimension: ad_group_id { 47 | type: string 48 | sql: ${TABLE}.adGroupId ;; 49 | } 50 | 51 | dimension: advertiser_id { 52 | type: string 53 | sql: ${TABLE}.advertiserId ;; 54 | } 55 | 56 | dimension: agency_id { 57 | type: string 58 | sql: ${TABLE}.agencyId ;; 59 | } 60 | 61 | dimension: bid_strategy_inherited { 62 | type: yesno 63 | sql: ${TABLE}.bidStrategyInherited ;; 64 | } 65 | 66 | dimension: bing_keyword_param2 { 67 | hidden: yes 68 | type: string 69 | sql: ${TABLE}.bingKeywordParam2 ;; 70 | } 71 | 72 | dimension: bing_keyword_param3 { 73 | hidden: yes 74 | type: string 75 | sql: ${TABLE}.bingKeywordParam3 ;; 76 | } 77 | 78 | dimension: campaign_id { 79 | type: string 80 | sql: ${TABLE}.campaignId ;; 81 | } 82 | 83 | dimension_group: creation { 84 | type: time 85 | timeframes: [ 86 | raw, 87 | time, 88 | date, 89 | week, 90 | month, 91 | quarter, 92 | year 93 | ] 94 | sql: ${TABLE}.creationTimestamp ;; 95 | } 96 | 97 | dimension: effective_bid_strategy_id { 98 | type: string 99 | sql: ${TABLE}.effectiveBidStrategyId ;; 100 | } 101 | 102 | dimension: effective_keyword_max_cpc { 103 | description: "Overrides the ad group's max CPC and sets a maximum amount you are willing to pay if someone clicks an ad for this specific keyword. If this field is empty, the keyword will use the ad group's max CPC." 104 | type: number 105 | sql: ${TABLE}.effectiveKeywordMaxCpc ;; 106 | } 107 | 108 | dimension: effective_labels { 109 | type: string 110 | sql: ${TABLE}.effectiveLabels ;; 111 | } 112 | 113 | dimension: engine_status { 114 | type: string 115 | sql: ${TABLE}.engineStatus ;; 116 | } 117 | 118 | dimension: is_display_keyword { 119 | description: "Indicates whether this is a placeholder keyword that is used for display and placement reporting." 120 | type: yesno 121 | sql: ${TABLE}.isDisplayKeyword ;; 122 | } 123 | 124 | dimension: keyword_clickserver_url { 125 | hidden: yes 126 | type: string 127 | sql: ${TABLE}.keywordClickserverUrl ;; 128 | } 129 | 130 | dimension: keyword_engine_id { 131 | type: string 132 | sql: ${TABLE}.keywordEngineId ;; 133 | } 134 | 135 | dimension: keyword_id { 136 | type: string 137 | sql: ${TABLE}.keywordId ;; 138 | } 139 | 140 | dimension: keyword_labels { 141 | type: string 142 | sql: ${TABLE}.keywordLabels ;; 143 | } 144 | 145 | dimension: keyword_landing_page { 146 | type: string 147 | sql: ${TABLE}.keywordLandingPage ;; 148 | html: 149 | ;; 150 | } 151 | 152 | dimension: keyword_match_type { 153 | type: string 154 | sql: ${TABLE}.keywordMatchType ;; 155 | } 156 | 157 | dimension: keyword_max_bid { 158 | description: "If this keyword is managed by a DS bid strategy, the bid strategy will never raise bids above this limit." 159 | type: number 160 | value_format_name: id 161 | sql: ${TABLE}.keywordMaxBid ;; 162 | } 163 | 164 | dimension: keyword_max_cpc { 165 | description: "Overrides the ad group's max CPC and sets a maximum amount you are willing to pay if someone clicks an ad for this specific keyword. If this field is empty, the keyword will use the ad group's max CPC." 166 | type: number 167 | sql: ${TABLE}.keywordMaxCpc ;; 168 | } 169 | 170 | dimension: keyword_min_bid { 171 | description: "If this keyword is managed by a DS bid strategy, the bid strategy will never lower bids below this limit." 172 | type: number 173 | value_format_name: id 174 | sql: ${TABLE}.keywordMinBid ;; 175 | } 176 | 177 | dimension: keyword_text { 178 | type: string 179 | sql: ${TABLE}.keywordText ;; 180 | link: { 181 | url: "/dashboards/block_sa360_v2::keyword_performance?Keyword={{ value | encode_uri }}" 182 | label: "Keyword Performance Lookup" 183 | } 184 | } 185 | 186 | dimension: keyword_url_params { 187 | hidden: yes 188 | type: string 189 | sql: ${TABLE}.keywordUrlParams ;; 190 | } 191 | 192 | dimension_group: last_modified { 193 | type: time 194 | timeframes: [ 195 | raw, 196 | time, 197 | date, 198 | week, 199 | month, 200 | quarter, 201 | year 202 | ] 203 | sql: ${TABLE}.lastModifiedTimestamp ;; 204 | } 205 | 206 | dimension: quality_score_current { 207 | description: "Google Ads and Bing Ads only. The most recent value of the engine's Quality score (QS) for a keyword." 208 | type: number 209 | sql: ${TABLE}.qualityScoreCurrent ;; 210 | } 211 | 212 | dimension: status { 213 | type: string 214 | sql: ${TABLE}.status ;; 215 | } 216 | 217 | dimension: top_of_page_bid_current { 218 | description: "Google Ads only. Approximates the current CPC bid needed for your ad to appear regularly in the top positions above the search results." 219 | type: number 220 | sql: ${TABLE}.topOfPageBidCurrent ;; 221 | } 222 | 223 | measure: count { 224 | type: count 225 | drill_fields: [] 226 | } 227 | } -------------------------------------------------------------------------------- /views/campaign_conversion_events.view.lkml: -------------------------------------------------------------------------------- 1 | view: campaign_conversion_events { 2 | view_label: "Campaign Events" 3 | sql_table_name: `@{SA_360_SCHEMA}.CampaignFloodlightAndDeviceStats_@{ADVERTISER_ID}`;; 4 | 5 | dimension_group: _data { 6 | hidden: yes 7 | type: time 8 | timeframes: [ 9 | raw, 10 | date, 11 | week, 12 | month, 13 | quarter, 14 | year 15 | ] 16 | convert_tz: no 17 | datatype: date 18 | sql: ${TABLE}._DATA_DATE ;; 19 | } 20 | 21 | dimension_group: _latest { 22 | hidden: yes 23 | type: time 24 | timeframes: [ 25 | raw, 26 | date, 27 | week, 28 | month, 29 | quarter, 30 | year 31 | ] 32 | convert_tz: no 33 | datatype: date 34 | sql: ${TABLE}._LATEST_DATE ;; 35 | } 36 | 37 | dimension: account_id { 38 | hidden: yes 39 | type: string 40 | sql: ${TABLE}.accountId ;; 41 | } 42 | 43 | dimension: advertiser_id { 44 | hidden: yes 45 | type: string 46 | sql: ${TABLE}.advertiserId ;; 47 | } 48 | 49 | dimension: agency_id { 50 | hidden: yes 51 | type: string 52 | sql: ${TABLE}.agencyId ;; 53 | } 54 | 55 | dimension: campaign_engine_id { 56 | hidden: yes 57 | type: string 58 | sql: ${TABLE}.campaignEngineId ;; 59 | } 60 | 61 | dimension: campaign_id { 62 | hidden: yes 63 | type: string 64 | sql: ${TABLE}.campaignId ;; 65 | } 66 | 67 | dimension_group: date { 68 | hidden: yes 69 | type: time 70 | timeframes: [ 71 | raw, 72 | date, 73 | week, 74 | month, 75 | quarter, 76 | year 77 | ] 78 | convert_tz: no 79 | datatype: date 80 | sql: ${TABLE}.date ;; 81 | } 82 | 83 | dimension: device_segment { 84 | type: string 85 | sql: ${TABLE}.deviceSegment ;; 86 | } 87 | 88 | dimension: dfa_actions { 89 | hidden: yes 90 | type: number 91 | sql: ${TABLE}.dfaActions ;; 92 | } 93 | 94 | dimension: dfa_revenue { 95 | hidden: yes 96 | type: number 97 | sql: ${TABLE}.dfaRevenue ;; 98 | } 99 | 100 | dimension: dfa_transactions { 101 | hidden: yes 102 | type: number 103 | sql: ${TABLE}.dfaTransactions ;; 104 | } 105 | 106 | dimension: dfa_weighted_actions { 107 | hidden: yes 108 | type: number 109 | sql: ${TABLE}.dfaWeightedActions ;; 110 | } 111 | 112 | dimension: effective_bid_strategy_id { 113 | hidden: yes 114 | type: string 115 | sql: ${TABLE}.effectiveBidStrategyId ;; 116 | } 117 | 118 | dimension: floodlight_activity_id { 119 | hidden: yes 120 | type: string 121 | sql: ${TABLE}.floodlightActivityId ;; 122 | } 123 | 124 | dimension: floodlight_group_id { 125 | hidden: yes 126 | type: string 127 | sql: ${TABLE}.floodlightGroupId ;; 128 | } 129 | 130 | ##### Campaign Standard Metric Aggregates ##### 131 | 132 | measure: total_actions { 133 | type: sum 134 | sql: ${dfa_actions} ;; 135 | } 136 | 137 | measure: total_transactions { 138 | type: sum 139 | sql: ${dfa_transactions} ;; 140 | } 141 | 142 | measure: total_conversions { 143 | description: "Sum of Dfa Actions and Dfa Transactions" 144 | type: number 145 | sql: ${total_actions} + ${total_transactions} ;; 146 | drill_fields: [campaign.campaign, total_conversions, cost_per_acquisition, total_actions, total_transactions] 147 | value_format:"[<1000]0.00;[<1000000]0.00,\" K\";0.00,,\" M\"" 148 | 149 | } 150 | 151 | ##### Campaign Conversion Metrics ##### 152 | 153 | measure: total_revenue { 154 | type: sum 155 | value_format_name: usd_0 156 | sql: ${dfa_revenue} ;; 157 | drill_fields: [campaign.campaign, total_revenue, campaign_events.total_cost, ROAS] 158 | 159 | } 160 | 161 | measure: ROAS { 162 | description: "Associated revenue divided by the total cost" 163 | type: number 164 | value_format_name: percent_0 165 | sql: 1.0 * ${total_revenue} / NULLIF(${campaign_events.total_cost},0) ;; 166 | drill_fields: [campaign.campaign, ROAS, total_revenue, campaign.total_cost] 167 | } 168 | 169 | measure: cost_per_acquisition { 170 | label: "Cost per Acquisition (CPA)" 171 | description: "Average cost per conversion" 172 | type: number 173 | value_format_name: usd 174 | sql: ${campaign_events.total_cost}*1.0/NULLIF(${total_conversions},0) ;; 175 | drill_fields: [campaign.campaign, cost_per_acquisition, campaign_events.total_cost, total_conversions] 176 | } 177 | 178 | measure: conversion_rate { 179 | description: "Conversions divided by Clicks" 180 | type: number 181 | value_format_name: percent_2 182 | sql: 1.0 * ${total_conversions} / NULLIF(${campaign_events.total_clicks},0) ;; 183 | drill_fields: [campaign.campaign, conversion_rate, total_actions, campaign_events.total_clicks] 184 | } 185 | 186 | ###################### Period over Period Reporting Metrics ###################### 187 | 188 | filter: this_period_filter { 189 | view_label: "Period over Period" 190 | group_label: "Arbitrary Period Comparisons" 191 | type: date 192 | } 193 | 194 | filter: prior_period_filter { 195 | view_label: "Period over Period" 196 | group_label: "Arbitrary Period Comparisons" 197 | type: date 198 | } 199 | 200 | dimension: days_from_start_first { 201 | view_label: "Period over Period" 202 | hidden: yes 203 | type: number 204 | sql: DATE_DIFF( ${_data_raw}, CAST({% date_start this_period_filter %} AS DATE), DAY) ;; 205 | } 206 | 207 | dimension: days_from_start_second { 208 | view_label: "Period over Period" 209 | hidden: yes 210 | type: number 211 | sql: DATE_DIFF(${_data_raw}, CAST({% date_start prior_period_filter %} AS DATE), DAY) ;; 212 | } 213 | 214 | dimension: days_from_period_start { 215 | view_label: "Period over Period" 216 | type: number 217 | sql: 218 | CASE 219 | WHEN ${days_from_start_first} >= 0 220 | THEN ${days_from_start_first} 221 | WHEN ${days_from_start_second} >= 0 222 | THEN ${days_from_start_second} 223 | END;; 224 | } 225 | 226 | dimension: period_selected { 227 | view_label: "Period over Period" 228 | type: string 229 | sql: 230 | CASE 231 | WHEN ${_data_raw} >= DATE({% date_start this_period_filter %}) 232 | AND ${_data_raw} <= DATE({% date_end this_period_filter %}) 233 | THEN 'This Period' 234 | WHEN ${_data_raw} >= DATE({% date_start prior_period_filter %}) 235 | AND ${_data_raw} <= DATE({% date_end prior_period_filter %}) 236 | THEN 'Prior Period' 237 | END ;; 238 | } 239 | ###################### Close - Period over Period Reporting Metrics ###################### 240 | } 241 | -------------------------------------------------------------------------------- /views/ad_group_conversion_events.view.lkml: -------------------------------------------------------------------------------- 1 | view: ad_group_conversion_events { 2 | view_label: "Ad Group Events" 3 | sql_table_name: `@{SA_360_SCHEMA}.AdGroupFloodlightAndDeviceStats_@{ADVERTISER_ID}`;; 4 | 5 | dimension_group: _data { 6 | type: time 7 | timeframes: [ 8 | raw, 9 | date, 10 | week, 11 | month, 12 | month_name, 13 | quarter, 14 | year, 15 | day_of_week, 16 | time_of_day, 17 | hour_of_day 18 | ] 19 | convert_tz: no 20 | datatype: date 21 | sql: ${TABLE}._DATA_DATE ;; 22 | } 23 | 24 | dimension_group: _latest { 25 | hidden: yes 26 | type: time 27 | timeframes: [ 28 | raw, 29 | date, 30 | week, 31 | month, 32 | quarter, 33 | year 34 | ] 35 | convert_tz: no 36 | datatype: date 37 | sql: ${TABLE}._LATEST_DATE ;; 38 | } 39 | 40 | dimension: account_id { 41 | hidden: yes 42 | type: string 43 | sql: ${TABLE}.accountId ;; 44 | } 45 | 46 | dimension: ad_group_engine_id { 47 | hidden: yes 48 | type: string 49 | sql: ${TABLE}.adGroupEngineId ;; 50 | } 51 | 52 | dimension: ad_group_id { 53 | hidden: yes 54 | type: string 55 | sql: ${TABLE}.adGroupId ;; 56 | } 57 | 58 | dimension: advertiser_id { 59 | hidden: yes 60 | type: string 61 | sql: ${TABLE}.advertiserId ;; 62 | } 63 | 64 | dimension: agency_id { 65 | hidden: yes 66 | type: string 67 | sql: ${TABLE}.agencyId ;; 68 | } 69 | 70 | dimension: campaign_id { 71 | hidden: yes 72 | type: string 73 | sql: ${TABLE}.campaignId ;; 74 | } 75 | 76 | dimension_group: date { 77 | hidden: yes 78 | type: time 79 | timeframes: [ 80 | raw, 81 | date, 82 | week, 83 | month, 84 | quarter, 85 | year 86 | ] 87 | convert_tz: no 88 | datatype: date 89 | sql: ${TABLE}.date ;; 90 | } 91 | 92 | dimension: device_segment { 93 | type: string 94 | sql: ${TABLE}.deviceSegment ;; 95 | } 96 | 97 | dimension: dfa_actions { 98 | hidden: yes 99 | type: number 100 | sql: ${TABLE}.dfaActions ;; 101 | } 102 | 103 | dimension: dfa_revenue { 104 | hidden: yes 105 | type: number 106 | sql: ${TABLE}.dfaRevenue ;; 107 | } 108 | 109 | dimension: dfa_transactions { 110 | hidden: yes 111 | type: number 112 | sql: ${TABLE}.dfaTransactions ;; 113 | } 114 | 115 | dimension: dfa_weighted_actions { 116 | hidden: yes 117 | type: number 118 | sql: ${TABLE}.dfaWeightedActions ;; 119 | } 120 | 121 | dimension: effective_bid_strategy_id { 122 | hidden: yes 123 | type: string 124 | sql: ${TABLE}.effectiveBidStrategyId ;; 125 | } 126 | 127 | dimension: floodlight_activity_id { 128 | hidden: yes 129 | type: string 130 | sql: ${TABLE}.floodlightActivityId ;; 131 | } 132 | 133 | dimension: floodlight_group_id { 134 | hidden: yes 135 | type: string 136 | sql: ${TABLE}.floodlightGroupId ;; 137 | } 138 | 139 | ##### Ad Group Standard Metric Aggregates ##### 140 | 141 | measure: total_actions { 142 | type: sum 143 | sql: ${dfa_actions} ;; 144 | } 145 | 146 | measure: total_transactions { 147 | type: sum 148 | sql: ${dfa_transactions} ;; 149 | } 150 | 151 | measure: total_conversions { 152 | description: "Sum of Dfa Actions and Dfa Transactions" 153 | type: number 154 | sql: ${total_actions} + ${total_transactions} ;; 155 | drill_fields: [ad_group.ad_group, total_conversions, cost_per_acquisition, total_actions, total_transactions] 156 | value_format:"[<1000]0.00;[<1000000]0.00,\" K\";0.00,,\" M\"" 157 | } 158 | 159 | ##### Ad Group Conversion Metrics ##### 160 | 161 | measure: total_revenue { 162 | type: sum 163 | value_format_name: usd_0 164 | sql: ${dfa_revenue} ;; 165 | drill_fields: [ad_group.ad_group, total_revenue, ad_group_events.total_cost] 166 | } 167 | 168 | measure: roas { 169 | description: "Associated revenue divided by the total cost" 170 | type: number 171 | value_format_name: percent_0 172 | sql: 1.0 * ${total_revenue} / NULLIF(${ad_group_events.total_cost},0) ;; 173 | drill_fields: [ad_group.ad_group, roas, total_revenue, ad_group_events.total_cost] 174 | } 175 | 176 | measure: cost_per_acquisition { 177 | label: "Cost per Acquisition (CPA)" 178 | description: "Average cost per conversion" 179 | type: number 180 | value_format_name: usd 181 | sql: ${ad_group_events.total_cost}*1.0/NULLIF(${total_conversions},0) ;; 182 | drill_fields: [ad_group.ad_group, cost_per_acquisition, ad_group_events.total_cost, total_conversions] 183 | } 184 | 185 | measure: conversion_rate { 186 | description: "Conversions divided by Clicks" 187 | type: number 188 | value_format_name: percent_2 189 | sql: 1.0 * ${total_conversions} / NULLIF(${ad_group_events.total_clicks},0) ;; 190 | drill_fields: [ad_group.ad_group, conversion_rate, total_actions, ad_group_events.total_clicks] 191 | } 192 | 193 | ###################### Period over Period Reporting Metrics ###################### 194 | 195 | filter: this_period_filter { 196 | view_label: "Period over Period" 197 | group_label: "Arbitrary Period Comparisons" 198 | type: date 199 | } 200 | 201 | filter: prior_period_filter { 202 | view_label: "Period over Period" 203 | group_label: "Arbitrary Period Comparisons" 204 | type: date 205 | } 206 | 207 | dimension: days_from_start_first { 208 | view_label: "Period over Period" 209 | hidden: yes 210 | type: number 211 | sql: DATE_DIFF( ${_data_raw}, CAST({% date_start this_period_filter %} AS DATE), DAY) ;; 212 | } 213 | 214 | dimension: days_from_start_second { 215 | view_label: "Period over Period" 216 | hidden: yes 217 | type: number 218 | sql: DATE_DIFF(${_data_raw}, CAST({% date_start prior_period_filter %} AS DATE), DAY) ;; 219 | } 220 | 221 | dimension: days_from_period_start { 222 | view_label: "Period over Period" 223 | type: number 224 | sql: 225 | CASE 226 | WHEN ${days_from_start_first} >= 0 227 | THEN ${days_from_start_first} 228 | WHEN ${days_from_start_second} >= 0 229 | THEN ${days_from_start_second} 230 | END;; 231 | } 232 | 233 | dimension: period_selected { 234 | view_label: "Period over Period" 235 | type: string 236 | sql: 237 | CASE 238 | WHEN ${_data_raw} >= DATE({% date_start this_period_filter %}) 239 | AND ${_data_raw} <= DATE({% date_end this_period_filter %}) 240 | THEN 'This Period' 241 | WHEN ${_data_raw} >= DATE({% date_start prior_period_filter %}) 242 | AND ${_data_raw} <= DATE({% date_end prior_period_filter %}) 243 | THEN 'Prior Period' 244 | END ;; 245 | } 246 | ###################### Close - Period over Period Reporting Metrics ###################### 247 | } 248 | -------------------------------------------------------------------------------- /views/product_conversion_events.view.lkml: -------------------------------------------------------------------------------- 1 | view: product_conversion_events { 2 | sql_table_name: `@{SA_360_SCHEMA}.ProductAdvertisedFloodlightAndDeviceStats_@{ADVERTISER_ID}` 3 | ;; 4 | 5 | dimension: advertiser_composite_key { 6 | hidden: yes 7 | sql: ${advertiser_id} || ' ' || ${_data_date} ;; 8 | } 9 | 10 | dimension: account_composite_key { 11 | hidden: yes 12 | sql: ${account_id} || ' ' || ${_data_date} ;; 13 | } 14 | 15 | dimension: product_composite_key { 16 | primary_key: yes 17 | sql: ${product_id} || ' ' || ${_data_date} ;; 18 | } 19 | 20 | dimension_group: _data { 21 | hidden: yes 22 | type: time 23 | timeframes: [ 24 | raw, 25 | date, 26 | week, 27 | month, 28 | quarter, 29 | year 30 | ] 31 | convert_tz: no 32 | datatype: date 33 | sql: ${TABLE}._DATA_DATE ;; 34 | } 35 | 36 | dimension_group: _latest { 37 | hidden: yes 38 | type: time 39 | timeframes: [ 40 | raw, 41 | date, 42 | week, 43 | month, 44 | quarter, 45 | year 46 | ] 47 | convert_tz: no 48 | datatype: date 49 | sql: ${TABLE}._LATEST_DATE ;; 50 | } 51 | 52 | dimension: account_id { 53 | hidden: yes 54 | type: string 55 | sql: ${TABLE}.accountId ;; 56 | } 57 | 58 | dimension: ad_group_id { 59 | hidden: yes 60 | type: string 61 | sql: ${TABLE}.adGroupId ;; 62 | } 63 | 64 | dimension: advertiser_id { 65 | hidden: yes 66 | type: string 67 | sql: ${TABLE}.advertiserId ;; 68 | } 69 | 70 | dimension: agency_id { 71 | hidden: yes 72 | type: string 73 | sql: ${TABLE}.agencyId ;; 74 | } 75 | 76 | dimension: campaign_id { 77 | hidden: yes 78 | type: string 79 | sql: ${TABLE}.campaignId ;; 80 | } 81 | 82 | dimension_group: date { 83 | hidden: yes 84 | type: time 85 | timeframes: [ 86 | raw, 87 | date, 88 | week, 89 | month, 90 | quarter, 91 | year 92 | ] 93 | convert_tz: no 94 | datatype: date 95 | sql: ${TABLE}.date ;; 96 | } 97 | 98 | dimension: device_segment { 99 | type: string 100 | sql: ${TABLE}.deviceSegment ;; 101 | } 102 | 103 | dimension: dfa_actions { 104 | hidden: yes 105 | type: number 106 | sql: ${TABLE}.dfaActions ;; 107 | } 108 | 109 | dimension: dfa_revenue { 110 | hidden: yes 111 | type: number 112 | sql: ${TABLE}.dfaRevenue ;; 113 | } 114 | 115 | dimension: dfa_transactions { 116 | hidden: yes 117 | type: number 118 | sql: ${TABLE}.dfaTransactions ;; 119 | } 120 | 121 | dimension: dfa_weighted_actions { 122 | hidden: yes 123 | type: number 124 | sql: ${TABLE}.dfaWeightedActions ;; 125 | } 126 | 127 | dimension: floodlight_activity_id { 128 | hidden: yes 129 | type: string 130 | sql: ${TABLE}.floodlightActivityId ;; 131 | } 132 | 133 | dimension: floodlight_group_id { 134 | hidden: yes 135 | type: string 136 | sql: ${TABLE}.floodlightGroupId ;; 137 | } 138 | 139 | dimension: product_id { 140 | hidden: yes 141 | type: string 142 | sql: ${TABLE}.productId ;; 143 | } 144 | 145 | ##### Product Standard Metric Aggregates ##### 146 | 147 | measure: total_actions { 148 | type: sum 149 | sql: ${dfa_actions} ;; 150 | } 151 | 152 | measure: total_transactions { 153 | type: sum 154 | sql: ${dfa_transactions} ;; 155 | } 156 | 157 | measure: total_conversions { 158 | description: "Sum of Dfa Actions and Dfa Transactions" 159 | type: number 160 | sql: ${total_actions} + ${total_transactions} ;; 161 | drill_fields: [campaign.campaign, total_conversions, total_actions, total_transactions] 162 | value_format:"[<1000]0.00;[<1000000]0.00,\" K\";0.00,,\" M\"" 163 | } 164 | 165 | ##### Product Conversion Metrics ##### 166 | 167 | measure: total_revenue { 168 | type: sum 169 | value_format_name: usd_0 170 | sql: ${dfa_revenue} ;; 171 | drill_fields: [campaign.campaign, total_revenue, product_events.total_cost, cost_per_acquisition] 172 | } 173 | 174 | measure: ROAS { 175 | description: "Associated revenue divided by the total cost" 176 | type: number 177 | value_format_name: percent_0 178 | sql: 1.0 * ${total_revenue} / NULLIF(${product_events.total_cost},0) ;; 179 | drill_fields: [campaign.campaign, ROAS, total_revenue, product_events.total_cost] 180 | } 181 | 182 | measure: cost_per_acquisition { 183 | label: "Cost per Acquisition (CPA)" 184 | description: "Average cost per conversion" 185 | type: number 186 | value_format_name: usd 187 | sql: ${product_events.total_cost}*1.0/NULLIF(${total_conversions},0) ;; 188 | drill_fields: [campaign.campaign, cost_per_acquisition, product_events.total_cost, total_conversions] 189 | } 190 | 191 | measure: conversion_rate { 192 | description: "Conversions divided by Clicks" 193 | type: number 194 | value_format_name: percent_2 195 | sql: 1.0 * ${total_conversions} / NULLIF(${product_events.total_clicks},0) ;; 196 | drill_fields: [campaign.campaign, conversion_rate, total_actions, product_events.total_clicks] 197 | } 198 | 199 | ###################### Period over Period Reporting Metrics ###################### 200 | 201 | filter: this_period_filter { 202 | view_label: "Period over Period" 203 | group_label: "Arbitrary Period Comparisons" 204 | type: date 205 | } 206 | 207 | filter: prior_period_filter { 208 | view_label: "Period over Period" 209 | group_label: "Arbitrary Period Comparisons" 210 | type: date 211 | } 212 | 213 | dimension: days_from_start_first { 214 | view_label: "Period over Period" 215 | hidden: yes 216 | type: number 217 | sql: DATE_DIFF( ${_data_raw}, CAST({% date_start this_period_filter %} AS DATE), DAY) ;; 218 | } 219 | 220 | dimension: days_from_start_second { 221 | view_label: "Period over Period" 222 | hidden: yes 223 | type: number 224 | sql: DATE_DIFF(${_data_raw}, CAST({% date_start prior_period_filter %} AS DATE), DAY) ;; 225 | } 226 | 227 | dimension: days_from_period_start { 228 | view_label: "Period over Period" 229 | type: number 230 | sql: 231 | CASE 232 | WHEN ${days_from_start_first} >= 0 233 | THEN ${days_from_start_first} 234 | WHEN ${days_from_start_second} >= 0 235 | THEN ${days_from_start_second} 236 | END;; 237 | } 238 | 239 | dimension: period_selected { 240 | view_label: "Period over Period" 241 | type: string 242 | sql: 243 | CASE 244 | WHEN ${_data_raw} >= DATE({% date_start this_period_filter %}) 245 | AND ${_data_raw} <= DATE({% date_end this_period_filter %}) 246 | THEN 'This Period' 247 | WHEN ${_data_raw} >= DATE({% date_start prior_period_filter %}) 248 | AND ${_data_raw} <= DATE({% date_end prior_period_filter %}) 249 | THEN 'Prior Period' 250 | END ;; 251 | } 252 | ###################### Close - Period over Period Reporting Metrics ###################### 253 | 254 | 255 | } 256 | -------------------------------------------------------------------------------- /views/keyword_conversion_events.view.lkml: -------------------------------------------------------------------------------- 1 | view: keyword_conversion_events { 2 | sql_table_name: `@{SA_360_SCHEMA}.KeywordFloodlightAndDeviceStats_@{ADVERTISER_ID}`;; 3 | 4 | dimension_group: _data { 5 | hidden: yes 6 | type: time 7 | timeframes: [ 8 | raw, 9 | date, 10 | week, 11 | month, 12 | quarter, 13 | year, 14 | day_of_month, 15 | day_of_week 16 | ] 17 | convert_tz: no 18 | datatype: date 19 | sql: ${TABLE}._DATA_DATE ;; 20 | } 21 | 22 | dimension_group: _latest { 23 | hidden: yes 24 | type: time 25 | timeframes: [ 26 | raw, 27 | date, 28 | week, 29 | month, 30 | quarter, 31 | year 32 | ] 33 | convert_tz: no 34 | datatype: date 35 | sql: ${TABLE}._LATEST_DATE ;; 36 | } 37 | 38 | dimension: account_id { 39 | hidden: yes 40 | type: string 41 | sql: ${TABLE}.accountId ;; 42 | } 43 | 44 | dimension: ad_group_id { 45 | hidden: yes 46 | type: string 47 | sql: ${TABLE}.adGroupId ;; 48 | } 49 | 50 | dimension: ad_id { 51 | hidden: yes 52 | type: string 53 | sql: ${TABLE}.adId ;; 54 | } 55 | 56 | dimension: advertiser_id { 57 | hidden: yes 58 | type: string 59 | sql: ${TABLE}.advertiserId ;; 60 | } 61 | 62 | dimension: agency_id { 63 | hidden: yes 64 | type: string 65 | sql: ${TABLE}.agencyId ;; 66 | } 67 | 68 | dimension: campaign_id { 69 | hidden: yes 70 | type: string 71 | sql: ${TABLE}.campaignId ;; 72 | } 73 | 74 | dimension_group: visit { 75 | hidden: yes 76 | type: time 77 | timeframes: [ 78 | raw, 79 | date, 80 | week, 81 | month, 82 | quarter, 83 | year 84 | ] 85 | convert_tz: no 86 | datatype: date 87 | sql: ${TABLE}.date ;; 88 | } 89 | 90 | dimension: device_segment { 91 | type: string 92 | sql: ${TABLE}.deviceSegment ;; 93 | } 94 | 95 | dimension: dfa_actions { 96 | hidden: yes 97 | type: number 98 | sql: ${TABLE}.dfaActions ;; 99 | } 100 | 101 | dimension: dfa_revenue { 102 | hidden: yes 103 | type: number 104 | sql: ${TABLE}.dfaRevenue ;; 105 | } 106 | 107 | dimension: dfa_transactions { 108 | hidden: yes 109 | type: number 110 | sql: ${TABLE}.dfaTransactions ;; 111 | } 112 | 113 | dimension: dfa_weighted_actions { 114 | hidden: yes 115 | type: number 116 | sql: ${TABLE}.dfaWeightedActions ;; 117 | } 118 | 119 | dimension: effective_bid_strategy_id { 120 | hidden: yes 121 | type: string 122 | sql: ${TABLE}.effectiveBidStrategyId ;; 123 | } 124 | 125 | dimension: floodlight_activity_id { 126 | hidden: yes 127 | type: string 128 | sql: ${TABLE}.floodlightActivityId ;; 129 | } 130 | 131 | dimension: floodlight_group_id { 132 | hidden: yes 133 | type: string 134 | sql: ${TABLE}.floodlightGroupId ;; 135 | } 136 | 137 | dimension: keyword_engine_id { 138 | hidden: yes 139 | type: string 140 | sql: ${TABLE}.keywordEngineId ;; 141 | } 142 | 143 | dimension: keyword_id { 144 | primary_key: yes 145 | hidden: yes 146 | type: string 147 | sql: ${TABLE}.keywordId ;; 148 | } 149 | 150 | ##### Keyword Standard Metric Aggregates ##### 151 | 152 | measure: total_actions { 153 | type: sum 154 | sql: ${dfa_actions} ;; 155 | drill_fields: [_data_date,total_actions] 156 | } 157 | 158 | measure: total_transactions { 159 | type: sum 160 | sql: ${dfa_transactions} ;; 161 | drill_fields: [_data_date,total_transactions] 162 | } 163 | 164 | measure: total_conversions { 165 | description: "Sum of Dfa Actions and Dfa Transactions" 166 | type: number 167 | sql: ${total_actions} + ${total_transactions} ;; 168 | drill_fields: [_data_date, keyword.keyword_text, total_conversions] 169 | value_format:"[<1000]0.00;[<1000000]0.00,\" K\";0.00,,\" M\"" 170 | } 171 | 172 | ##### Keyword Conversion Metrics ##### 173 | 174 | measure: total_revenue { 175 | description: "Aggregate revenue generated by Campaign manager transactions." 176 | type: sum 177 | value_format_name: usd_0 178 | sql: ${dfa_revenue} ;; 179 | drill_fields: [_data_date, keyword.keyword_text, total_revenue] 180 | } 181 | 182 | measure: ROAS { 183 | description: "Associated revenue divided by the total cost" 184 | type: number 185 | value_format_name: percent_0 186 | sql: 1.0 * ${total_revenue} / NULLIF(${keyword_events.total_cost},0) ;; 187 | drill_fields: [_data_date, keyword.keyword_text, ROAS, total_revenue, keyword_events_core.total_cost] 188 | } 189 | 190 | measure: cost_per_acquisition { 191 | label: "Cost per Acquisition (CPA)" 192 | description: "Average cost per conversion" 193 | type: number 194 | value_format_name: usd 195 | sql: ${keyword_events.total_cost}*1.0/NULLIF(${total_conversions},0) ;; 196 | drill_fields: [_data_date, keyword_core.keyword_text, cost_per_acquisition, keyword_events.total_cost, total_conversions] 197 | } 198 | 199 | measure: conversion_rate { 200 | description: "Conversions divided by Clicks" 201 | type: number 202 | value_format_name: percent_2 203 | sql: 1.0 * ${total_conversions} / NULLIF(${keyword_events.total_clicks},0) ;; 204 | drill_fields: [_data_date, keyword.keyword_text, conversion_rate, total_actions, keyword_events.total_clicks] 205 | } 206 | 207 | 208 | 209 | ###################### Period over Period Reporting Metrics ###################### 210 | 211 | filter: this_period_filter { 212 | view_label: "Period over Period" 213 | group_label: "Arbitrary Period Comparisons" 214 | type: date 215 | } 216 | 217 | filter: prior_period_filter { 218 | view_label: "Period over Period" 219 | group_label: "Arbitrary Period Comparisons" 220 | type: date 221 | } 222 | 223 | dimension: days_from_start_first { 224 | view_label: "Period over Period" 225 | hidden: yes 226 | type: number 227 | sql: DATE_DIFF( ${_data_raw}, CAST({% date_start this_period_filter %} AS DATE), DAY) ;; 228 | } 229 | 230 | dimension: days_from_start_second { 231 | view_label: "Period over Period" 232 | hidden: yes 233 | type: number 234 | sql: DATE_DIFF(${_data_raw}, CAST({% date_start prior_period_filter %} AS DATE), DAY) ;; 235 | } 236 | 237 | dimension: days_from_period_start { 238 | view_label: "Period over Period" 239 | type: number 240 | sql: 241 | CASE 242 | WHEN ${days_from_start_first} >= 0 243 | THEN ${days_from_start_first} 244 | WHEN ${days_from_start_second} >= 0 245 | THEN ${days_from_start_second} 246 | END;; 247 | } 248 | 249 | dimension: period_selected { 250 | view_label: "Period over Period" 251 | type: string 252 | sql: 253 | CASE 254 | WHEN ${_data_raw} >= DATE({% date_start this_period_filter %}) 255 | AND ${_data_raw} <= DATE({% date_end this_period_filter %}) 256 | THEN 'This Period' 257 | WHEN ${_data_raw} >= DATE({% date_start prior_period_filter %}) 258 | AND ${_data_raw} <= DATE({% date_end prior_period_filter %}) 259 | THEN 'Prior Period' 260 | END ;; 261 | } 262 | ###################### Close - Period over Period Reporting Metrics ###################### 263 | 264 | } 265 | -------------------------------------------------------------------------------- /views/ad_group_events.view.lkml: -------------------------------------------------------------------------------- 1 | view: ad_group_events { 2 | sql_table_name: `@{SA_360_SCHEMA}.AdGroupDeviceStats_@{ADVERTISER_ID}`;; 3 | 4 | dimension: ad_group_composite_key { 5 | hidden: yes 6 | sql: ${ad_group_id} || ' ' || ${_data_date} ;; 7 | } 8 | 9 | dimension: campaign_composite_key { 10 | hidden: yes 11 | sql: ${campaign_id} || ' ' || ${_data_date} ;; 12 | } 13 | 14 | dimension: advertiser_composite_key { 15 | hidden: yes 16 | sql: ${advertiser_id} || ' ' || ${_data_date} ;; 17 | } 18 | 19 | dimension: account_composite_key { 20 | hidden: yes 21 | sql: ${account_id} || ' ' || ${_data_date} ;; 22 | } 23 | 24 | dimension_group: _data { 25 | hidden: yes 26 | type: time 27 | timeframes: [ 28 | raw, 29 | date, 30 | week, 31 | month, 32 | month_name, 33 | quarter, 34 | year, 35 | day_of_week, 36 | time_of_day, 37 | hour_of_day 38 | ] 39 | convert_tz: no 40 | datatype: datetime 41 | sql: ${TABLE}._DATA_DATE ;; 42 | } 43 | 44 | dimension_group: _latest { 45 | hidden: yes 46 | type: time 47 | timeframes: [ 48 | raw, 49 | date, 50 | week, 51 | month, 52 | quarter, 53 | year 54 | ] 55 | convert_tz: no 56 | datatype: date 57 | sql: ${TABLE}._LATEST_DATE ;; 58 | } 59 | 60 | dimension: account_id { 61 | hidden: yes 62 | type: string 63 | sql: ${TABLE}.accountId ;; 64 | } 65 | 66 | dimension: ad_group_engine_id { 67 | hidden: yes 68 | type: string 69 | sql: ${TABLE}.adGroupEngineId ;; 70 | } 71 | 72 | dimension: ad_group_id { 73 | hidden: yes 74 | type: string 75 | sql: ${TABLE}.adGroupId ;; 76 | } 77 | 78 | dimension: ad_words_conversion_value { 79 | hidden: yes 80 | type: number 81 | sql: ${TABLE}.adWordsConversionValue ;; 82 | } 83 | 84 | dimension: ad_words_conversions { 85 | hidden: yes 86 | type: number 87 | sql: ${TABLE}.adWordsConversions ;; 88 | } 89 | 90 | dimension: ad_words_view_through_conversions { 91 | hidden: yes 92 | type: number 93 | sql: ${TABLE}.adWordsViewThroughConversions ;; 94 | } 95 | 96 | dimension: advertiser_id { 97 | hidden: yes 98 | type: string 99 | sql: ${TABLE}.advertiserId ;; 100 | } 101 | 102 | dimension: agency_id { 103 | hidden: yes 104 | type: string 105 | sql: ${TABLE}.agencyId ;; 106 | } 107 | 108 | dimension: avg_cpc { 109 | hidden: yes 110 | type: number 111 | sql: ${TABLE}.avgCpc ;; 112 | } 113 | 114 | dimension: avg_cpm { 115 | hidden: yes 116 | type: number 117 | sql: ${TABLE}.avgCpm ;; 118 | } 119 | 120 | dimension: avg_pos { 121 | hidden: yes 122 | type: number 123 | sql: ${TABLE}.avgPos ;; 124 | } 125 | 126 | dimension: campaign_id { 127 | type: string 128 | sql: ${TABLE}.campaignId ;; 129 | } 130 | 131 | dimension: clicks { 132 | hidden: yes 133 | type: number 134 | sql: ${TABLE}.clicks ;; 135 | } 136 | 137 | dimension: cost { 138 | hidden: yes 139 | type: number 140 | sql: ${TABLE}.cost ;; 141 | } 142 | 143 | dimension: ctr { 144 | hidden: yes 145 | type: number 146 | sql: ${TABLE}.ctr ;; 147 | } 148 | 149 | dimension_group: date { 150 | hidden: yes 151 | type: time 152 | timeframes: [ 153 | raw, 154 | date, 155 | week, 156 | month, 157 | quarter, 158 | year 159 | ] 160 | convert_tz: no 161 | datatype: date 162 | sql: ${TABLE}.date ;; 163 | } 164 | 165 | dimension: device_segment { 166 | hidden: yes 167 | type: string 168 | sql: ${TABLE}.deviceSegment ;; 169 | } 170 | 171 | dimension: effective_bid_strategy_id { 172 | hidden: yes 173 | type: string 174 | sql: ${TABLE}.effectiveBidStrategyId ;; 175 | } 176 | 177 | dimension: impr { 178 | hidden: yes 179 | type: number 180 | sql: ${TABLE}.impr ;; 181 | } 182 | 183 | dimension: visits { 184 | hidden: yes 185 | type: number 186 | sql: ${TABLE}.visits ;; 187 | } 188 | 189 | ##### Ad Event Metrics ##### 190 | 191 | measure: total_impressions { 192 | type: sum 193 | sql: ${impr} ;; 194 | drill_fields: [ad_group.ad_group, total_impressions] 195 | value_format:"[<1000]0.00;[<1000000]0.00,\" K\";0.00,,\" M\"" 196 | } 197 | 198 | measure: total_clicks { 199 | type: sum 200 | sql: ${clicks} ;; 201 | drill_fields: [ad_group.ad_group, total_clicks, click_through_rate, total_clicks, total_impressions] 202 | value_format:"[<1000]0.00;[<1000000]0.00,\" K\";0.00,,\" M\"" 203 | } 204 | 205 | measure: total_visits { 206 | type: sum 207 | sql: ${visits} ;; 208 | } 209 | 210 | measure: total_cost { 211 | label: "Total Spend (Search Clicks)" 212 | type: sum 213 | value_format_name: usd_0 214 | sql: ${cost} ;; 215 | drill_fields: [ad_group.ad_group, total_cost, total_clicks, ad_group_conversion_events.total_revenue] 216 | } 217 | 218 | measure: total_cumulative_spend { 219 | label: "Total Spend (Cumulative)" 220 | type: running_total 221 | sql: ${total_cost} ;; 222 | value_format_name: usd_0 223 | 224 | } 225 | 226 | measure: click_through_rate { 227 | label: "Click Through Rate (CTR)" 228 | description: "Percent of people that click on an ad." 229 | type: number 230 | value_format_name: percent_2 231 | sql: ${total_clicks}*1.0/NULLIF(${total_impressions},0);; 232 | drill_fields: [ad_group.ad_group, click_through_rate, total_clicks, total_impressions] 233 | } 234 | 235 | measure: cost_per_click { 236 | label: "Cost per Click (CPC)" 237 | description: "Average cost per ad click." 238 | type: number 239 | sql: ${total_cost}* 1.0/ NULLIF(${total_clicks},0) ;; 240 | value_format_name: usd 241 | drill_fields: [ad_group.ad_group, cost_per_click, total_cost, total_clicks] 242 | } 243 | 244 | #this parameter allows users to select the metric they want to look at 245 | parameter: metric_selector { 246 | description: "Use this filter to toggle between what metric matters most to your business" 247 | type: string 248 | allowed_value: { 249 | label: "Clicks" 250 | value: "total_clicks" 251 | } 252 | allowed_value: { 253 | label: "Conversions" 254 | value: "total_conversions" 255 | } 256 | allowed_value: { 257 | label: "Conversion Rate" 258 | value: "conversion_rate" 259 | } 260 | allowed_value: { 261 | label: "CTR" 262 | value: "click_through_rate" 263 | } 264 | allowed_value: { 265 | label: "ROAS" 266 | value: "roas" 267 | } 268 | } 269 | 270 | #this field can be used with the metric selector filter 271 | measure: metric { 272 | label_from_parameter: metric_selector 273 | type: number 274 | sql: 275 | CASE 276 | WHEN {% parameter metric_selector %} = 'total_clicks' 277 | THEN ${total_clicks} 278 | WHEN {% parameter metric_selector %} = 'total_conversions' 279 | THEN ${ad_group_conversion_events.total_conversions} 280 | WHEN {% parameter metric_selector %} = 'conversion_rate' 281 | THEN ${ad_group_conversion_events.conversion_rate} 282 | WHEN {% parameter metric_selector %} = 'click_through_rate' 283 | THEN ${click_through_rate} 284 | WHEN {% parameter metric_selector %} = 'roas' 285 | THEN ${ad_group_conversion_events.roas} 286 | ELSE NULL 287 | END ;; 288 | } 289 | 290 | 291 | } 292 | -------------------------------------------------------------------------------- /views/ad_group.view.lkml: -------------------------------------------------------------------------------- 1 | view: ad_group { 2 | sql_table_name: `@{SA_360_SCHEMA}.AdGroup_@{ADVERTISER_ID}`;; 3 | 4 | dimension: ad_group_composite_key { 5 | hidden: yes 6 | primary_key: yes 7 | sql: ${ad_group_id} || ' ' || ${_data_date} ;; 8 | } 9 | 10 | dimension_group: _data { 11 | hidden: yes 12 | type: time 13 | timeframes: [ 14 | raw, 15 | date, 16 | week, 17 | month, 18 | quarter, 19 | year 20 | ] 21 | convert_tz: no 22 | datatype: date 23 | sql: ${TABLE}._DATA_DATE ;; 24 | } 25 | 26 | dimension_group: _latest { 27 | hidden: yes 28 | type: time 29 | timeframes: [ 30 | raw, 31 | date, 32 | week, 33 | month, 34 | quarter, 35 | year 36 | ] 37 | convert_tz: no 38 | datatype: date 39 | sql: ${TABLE}._LATEST_DATE ;; 40 | } 41 | 42 | dimension: account_id { 43 | type: string 44 | sql: ${TABLE}.accountId ;; 45 | } 46 | 47 | dimension: ad_group { 48 | type: string 49 | sql: ${TABLE}.adGroup ;; 50 | link: { 51 | url: "https://searchads.google.com/ds/cm/cm?#adgroups.ay={{ campaign.agency_id._value }};av={{ campaign.advertiser_id._value }};ea={{ account.account_engine_id._value }};c={{ campaign.campaign_id._value }};ag={{ ad_group.ad_group_id._value }}" 52 | label: "View on SA360" 53 | icon_url: "https://storage.googleapis.com/support-kms-prod/kNxlBgSkVI3TZFe77PovWkoh0P9K7Vw1ovEJ" 54 | } 55 | } 56 | 57 | dimension: ad_group_broad_max_cpc { 58 | description: "Default bid for broad match search keywords in this ad group (Bing Ads only)." 59 | type: number 60 | sql: ${TABLE}.adGroupBroadMaxCpc ;; 61 | } 62 | 63 | dimension: ad_group_content_max_cpc { 64 | description: "Default bid for content keywords in this ad group." 65 | type: number 66 | sql: ${TABLE}.adGroupContentMaxCpc ;; 67 | } 68 | 69 | dimension_group: ad_group_end { 70 | type: time 71 | timeframes: [ 72 | raw, 73 | date, 74 | week, 75 | month, 76 | quarter, 77 | year 78 | ] 79 | convert_tz: no 80 | datatype: date 81 | sql: ${TABLE}.adGroupEndDate ;; 82 | } 83 | 84 | dimension: ad_group_engine_id { 85 | hidden: yes 86 | type: string 87 | sql: ${TABLE}.adGroupEngineId ;; 88 | } 89 | 90 | dimension: ad_group_exact_max_cpc { 91 | description: "Default bid for exact match keywords in this ad group (Bing Ads only)." 92 | type: number 93 | sql: ${TABLE}.adGroupExactMaxCpc ;; 94 | } 95 | 96 | dimension: ad_group_id { 97 | hidden: yes 98 | type: string 99 | sql: ${TABLE}.adGroupId ;; 100 | } 101 | 102 | dimension: ad_group_labels { 103 | type: string 104 | sql: ${TABLE}.adGroupLabels ;; 105 | } 106 | 107 | dimension: ad_group_mobile_bid_adjustment { 108 | description: "The percentage by which bids are adjusted for mobile." 109 | type: number 110 | sql: ${TABLE}.adGroupMobileBidAdjustment ;; 111 | } 112 | 113 | dimension: ad_group_phrase_max_cpc { 114 | description: "Default bid for phrasematch search keywords in this ad group (Bing Ads only)." 115 | type: number 116 | sql: ${TABLE}.adGroupPhraseMaxCpc ;; 117 | } 118 | 119 | dimension: ad_group_search_max_cpc { 120 | description: "Default bid for search keywords in this ad group." 121 | type: number 122 | sql: ${TABLE}.adGroupSearchMaxCpc ;; 123 | } 124 | 125 | dimension_group: ad_group_start { 126 | type: time 127 | timeframes: [ 128 | raw, 129 | date, 130 | week, 131 | month, 132 | quarter, 133 | year 134 | ] 135 | convert_tz: no 136 | datatype: date 137 | sql: ${TABLE}.adGroupStartDate ;; 138 | } 139 | 140 | dimension: advertiser_id { 141 | type: string 142 | sql: ${TABLE}.advertiserId ;; 143 | } 144 | 145 | dimension: agency_id { 146 | type: string 147 | sql: ${TABLE}.agencyId ;; 148 | } 149 | 150 | dimension: bid_strategy_inherited { 151 | type: yesno 152 | sql: ${TABLE}.bidStrategyInherited ;; 153 | } 154 | 155 | dimension: bing_ads_ad_distributions { 156 | description: "Ad distribution channels used by Bing Ads ad groups; a combination of Search and Content." 157 | type: string 158 | sql: ${TABLE}.bingAdsAdDistributions ;; 159 | } 160 | 161 | dimension: bing_ads_language { 162 | type: string 163 | sql: ${TABLE}.bingAdsLanguage ;; 164 | } 165 | 166 | dimension: campaign_id { 167 | type: string 168 | sql: ${TABLE}.campaignId ;; 169 | } 170 | 171 | dimension: city_targets { 172 | group_label: "Targets" 173 | type: string 174 | sql: ${TABLE}.cityTargets ;; 175 | } 176 | 177 | dimension: country_targets { 178 | group_label: "Targets" 179 | type: string 180 | sql: ${TABLE}.countryTargets ;; 181 | } 182 | 183 | dimension_group: creation { 184 | type: time 185 | timeframes: [ 186 | raw, 187 | time, 188 | date, 189 | week, 190 | month, 191 | quarter, 192 | year 193 | ] 194 | sql: ${TABLE}.creationTimestamp ;; 195 | } 196 | 197 | dimension: device_targets { 198 | group_label: "Targets" 199 | type: string 200 | sql: ${TABLE}.deviceTargets ;; 201 | } 202 | 203 | dimension: effective_bid_strategy_id { 204 | hidden: yes 205 | type: string 206 | sql: ${TABLE}.effectiveBidStrategyId ;; 207 | } 208 | 209 | dimension: effective_city_targets { 210 | group_label: "Targets" 211 | type: string 212 | sql: ${TABLE}.effectiveCityTargets ;; 213 | } 214 | 215 | dimension: effective_country_targets { 216 | group_label: "Targets" 217 | type: string 218 | sql: ${TABLE}.effectiveCountryTargets ;; 219 | } 220 | 221 | dimension: effective_device_targets { 222 | group_label: "Targets" 223 | type: string 224 | sql: ${TABLE}.effectiveDeviceTargets ;; 225 | } 226 | 227 | dimension: effective_labels { 228 | type: string 229 | sql: ${TABLE}.effectiveLabels ;; 230 | } 231 | 232 | dimension: effective_metro_targets { 233 | group_label: "Targets" 234 | type: string 235 | sql: ${TABLE}.effectiveMetroTargets ;; 236 | } 237 | 238 | dimension: effective_province_targets { 239 | group_label: "Targets" 240 | type: string 241 | sql: ${TABLE}.effectiveProvinceTargets ;; 242 | } 243 | 244 | dimension: is_engine_remarketing_list_target_all { 245 | description: "Indicates if the ad group only uses remarketing targets to adjust bids." 246 | type: yesno 247 | sql: ${TABLE}.engineRemarketingListTargetAll ;; 248 | } 249 | 250 | dimension: engine_status { 251 | description: "Additional status of the ad group in the external engine account." 252 | type: string 253 | sql: ${TABLE}.engineStatus ;; 254 | } 255 | 256 | dimension_group: last_modified { 257 | type: time 258 | timeframes: [ 259 | raw, 260 | time, 261 | date, 262 | week, 263 | month, 264 | quarter, 265 | year 266 | ] 267 | sql: ${TABLE}.lastModifiedTimestamp ;; 268 | } 269 | 270 | dimension: metro_targets { 271 | group_label: "Targets" 272 | type: string 273 | sql: ${TABLE}.metroTargets ;; 274 | } 275 | 276 | dimension: province_targets { 277 | group_label: "Targets" 278 | type: string 279 | sql: ${TABLE}.provinceTargets ;; 280 | } 281 | 282 | dimension: status { 283 | type: string 284 | sql: ${TABLE}.status ;; 285 | } 286 | 287 | measure: count { 288 | type: count 289 | drill_fields: [] 290 | } 291 | } 292 | -------------------------------------------------------------------------------- /views/keyword_events.view.lkml: -------------------------------------------------------------------------------- 1 | view: keyword_events { 2 | sql_table_name: `@{SA_360_SCHEMA}.KeywordDeviceStats_@{ADVERTISER_ID}`;; 3 | 4 | dimension: keyword_composite_key { 5 | hidden: yes 6 | sql: ${keyword_id} || ' ' || ${_data_date} ;; 7 | } 8 | 9 | dimension: ad_group_composite_key { 10 | hidden: yes 11 | sql: ${ad_group_id} || ' ' || ${_data_date} ;; 12 | } 13 | 14 | dimension: campaign_composite_key { 15 | hidden: yes 16 | sql: ${campaign_id} || ' ' || ${_data_date} ;; 17 | } 18 | 19 | dimension: advertiser_composite_key { 20 | hidden: yes 21 | sql: ${advertiser_id} || ' ' || ${_data_date} ;; 22 | } 23 | 24 | dimension: account_composite_key { 25 | hidden: yes 26 | sql: ${account_id} || ' ' || ${_data_date} ;; 27 | } 28 | 29 | dimension_group: _data { 30 | type: time 31 | timeframes: [ 32 | raw, 33 | hour_of_day, 34 | day_of_week, 35 | date, 36 | week, 37 | month, 38 | quarter, 39 | year 40 | ] 41 | convert_tz: no 42 | datatype: date 43 | sql: ${TABLE}._DATA_DATE ;; 44 | } 45 | 46 | dimension_group: _latest { 47 | hidden: yes 48 | type: time 49 | timeframes: [ 50 | raw, 51 | date, 52 | week, 53 | month, 54 | quarter, 55 | year 56 | ] 57 | convert_tz: no 58 | datatype: date 59 | sql: ${TABLE}._LATEST_DATE ;; 60 | } 61 | 62 | 63 | dimension: account_id { 64 | # hidden: yes 65 | type: string 66 | sql: ${TABLE}.accountId ;; 67 | } 68 | 69 | dimension: ad_group_id { 70 | # hidden: yes 71 | type: string 72 | sql: ${TABLE}.adGroupId ;; 73 | } 74 | 75 | dimension: ad_id { 76 | # hidden: yes 77 | type: string 78 | sql: ${TABLE}.adId ;; 79 | } 80 | 81 | dimension: ad_words_conversion_value { 82 | description: "Aggregate value of Google Ads conversions." 83 | type: number 84 | sql: ${TABLE}.adWordsConversionValue ;; 85 | } 86 | 87 | dimension: ad_words_conversions { 88 | description: "The data that the advertiser has set up to be reported in the Google Ads Conversions column. When an Google Ads conversion action is created, the advertiser can choose whether to count those conversions in the Conversions reporting column." 89 | type: number 90 | sql: ${TABLE}.adWordsConversions ;; 91 | } 92 | 93 | dimension: ad_words_view_through_conversions { 94 | description: "The total number of Google Ads view-through conversions." 95 | type: number 96 | sql: ${TABLE}.adWordsViewThroughConversions ;; 97 | } 98 | 99 | dimension: advertiser_id { 100 | hidden: yes 101 | type: string 102 | sql: ${TABLE}.advertiserId ;; 103 | } 104 | 105 | dimension: agency_id { 106 | hidden: yes 107 | type: string 108 | sql: ${TABLE}.agencyId ;; 109 | } 110 | 111 | dimension: avg_cpc { 112 | hidden: yes 113 | type: number 114 | sql: ${TABLE}.avgCpc ;; 115 | } 116 | 117 | dimension: avg_cpm { 118 | hidden: yes 119 | type: number 120 | sql: ${TABLE}.avgCpm ;; 121 | } 122 | 123 | dimension: avg_pos { 124 | hidden: yes 125 | type: number 126 | sql: ${TABLE}.avgPos ;; 127 | } 128 | 129 | dimension: campaign_id { 130 | hidden: yes 131 | type: string 132 | sql: ${TABLE}.campaignId ;; 133 | } 134 | 135 | dimension: clicks { 136 | hidden: yes 137 | type: number 138 | sql: ${TABLE}.clicks ;; 139 | } 140 | 141 | dimension: cost { 142 | hidden: yes 143 | type: number 144 | sql: ${TABLE}.cost ;; 145 | } 146 | 147 | dimension: ctr { 148 | hidden: yes 149 | type: number 150 | sql: ${TABLE}.ctr ;; 151 | } 152 | 153 | dimension_group: visit { 154 | hidden: yes 155 | type: time 156 | timeframes: [ 157 | raw, 158 | date, 159 | week, 160 | month, 161 | quarter, 162 | year 163 | ] 164 | convert_tz: no 165 | datatype: date 166 | sql: ${TABLE}.date ;; 167 | } 168 | 169 | dimension: device_segment { 170 | hidden: yes 171 | type: string 172 | sql: ${TABLE}.deviceSegment ;; 173 | } 174 | 175 | dimension: effective_bid_strategy_id { 176 | hidden: yes 177 | type: string 178 | sql: ${TABLE}.effectiveBidStrategyId ;; 179 | } 180 | 181 | dimension: impr { 182 | hidden: yes 183 | type: number 184 | sql: ${TABLE}.impr ;; 185 | } 186 | 187 | dimension: keyword_engine_id { 188 | hidden: yes 189 | type: string 190 | sql: ${TABLE}.keywordEngineId ;; 191 | } 192 | 193 | dimension: keyword_id { 194 | # hidden: yes 195 | type: string 196 | sql: ${TABLE}.keywordId ;; 197 | } 198 | 199 | dimension: visits { 200 | hidden: yes 201 | type: number 202 | sql: ${TABLE}.visits ;; 203 | } 204 | 205 | ##### Ad Event Metrics ##### 206 | 207 | measure: total_impressions { 208 | type: sum 209 | sql: ${impr} ;; 210 | drill_fields: [keyword.keyword_text, _data_date, total_impressions] 211 | value_format:"[<1000]0.00;[<1000000]0.00,\" K\";0.00,,\" M\"" 212 | } 213 | 214 | measure: total_clicks { 215 | type: sum 216 | sql: ${clicks} ;; 217 | drill_fields: [_data_date, keyword.keyword_text, total_clicks] 218 | value_format:"[<1000]0.00;[<1000000]0.00,\" K\";0.00,,\" M\"" 219 | } 220 | 221 | measure: total_visits { 222 | type: sum 223 | sql: ${visits} ;; 224 | } 225 | 226 | measure: total_cost { 227 | label: "Total Spend (Search Clicks)" 228 | type: sum 229 | value_format_name: usd_0 230 | sql: ${cost} ;; 231 | drill_fields: [_data_date, keyword.keyword_text, total_cost] 232 | } 233 | 234 | measure: total_cumulative_spend { 235 | label: "Total Spend (Cumulative)" 236 | type: running_total 237 | sql: ${total_cost} ;; 238 | value_format_name: usd_0 239 | 240 | } 241 | 242 | measure: click_through_rate { 243 | label: "Click Through Rate (CTR)" 244 | description: "Percent of people that click on an ad." 245 | type: number 246 | value_format_name: percent_2 247 | sql: ${total_clicks}*1.0/NULLIF(${total_impressions},0);; 248 | drill_fields: [_data_date, keyword.keyword_text, click_through_rate, total_clicks, total_impressions] 249 | } 250 | 251 | measure: cost_per_click { 252 | label: "Cost per Click (CPC)" 253 | description: "Average cost per ad click." 254 | type: number 255 | sql: ${total_cost}* 1.0/ NULLIF(${total_clicks},0) ;; 256 | value_format_name: usd 257 | drill_fields: [_data_date, keyword.keyword_text, cost_per_click, total_cost, total_clicks] 258 | } 259 | #this parameter allows users to select the metric they want to look at 260 | parameter: metric_selector { 261 | description: "Use this filter to toggle between what metric matters most to your business" 262 | type: string 263 | allowed_value: { 264 | label: "Clicks" 265 | value: "total_clicks" 266 | } 267 | allowed_value: { 268 | label: "Conversions" 269 | value: "total_conversions" 270 | } 271 | allowed_value: { 272 | label: "Conversion Rate" 273 | value: "conversion_rate" 274 | } 275 | allowed_value: { 276 | label: "CTR" 277 | value: "click_through_rate" 278 | } 279 | allowed_value: { 280 | label: "ROAS" 281 | value: "roas" 282 | } 283 | } 284 | 285 | #this field can be used with the metric selector filter 286 | measure: metric { 287 | label_from_parameter: metric_selector 288 | type: number 289 | sql: 290 | CASE 291 | WHEN {% parameter metric_selector %} = 'total_clicks' 292 | THEN ${total_clicks} 293 | WHEN {% parameter metric_selector %} = 'total_conversions' 294 | THEN ${keyword_conversion_events.total_conversions} 295 | WHEN {% parameter metric_selector %} = 'conversion_rate' 296 | THEN ${keyword_conversion_events.conversion_rate} 297 | WHEN {% parameter metric_selector %} = 'click_through_rate' 298 | THEN ${click_through_rate} 299 | WHEN {% parameter metric_selector %} = 'roas' 300 | THEN ${keyword_conversion_events.ROAS} 301 | ELSE NULL 302 | END ;; 303 | } 304 | 305 | 306 | } 307 | -------------------------------------------------------------------------------- /views/campaign.view.lkml: -------------------------------------------------------------------------------- 1 | view: campaign { 2 | sql_table_name: `@{SA_360_SCHEMA}.Campaign_@{ADVERTISER_ID}` 3 | ;; 4 | 5 | dimension: campaign_composite_key { 6 | primary_key: yes 7 | hidden: yes 8 | sql: ${campaign_id} || ' ' || ${_data_date} ;; 9 | } 10 | 11 | dimension_group: _data { 12 | type: time 13 | timeframes: [ 14 | raw, 15 | date, 16 | week, 17 | month, 18 | quarter, 19 | year 20 | ] 21 | convert_tz: no 22 | datatype: date 23 | sql: ${TABLE}._DATA_DATE ;; 24 | } 25 | 26 | dimension_group: _latest { 27 | hidden: yes 28 | type: time 29 | timeframes: [ 30 | raw, 31 | date, 32 | week, 33 | month, 34 | quarter, 35 | year 36 | ] 37 | convert_tz: no 38 | datatype: date 39 | sql: ${TABLE}._LATEST_DATE ;; 40 | } 41 | 42 | dimension: account_id { 43 | type: string 44 | sql: ${TABLE}.accountId ;; 45 | } 46 | 47 | dimension: ad_rotation { 48 | type: string 49 | sql: ${TABLE}.adRotation ;; 50 | } 51 | 52 | dimension: ad_words_bid_strategy { 53 | type: string 54 | sql: ${TABLE}.adWordsBidStrategy ;; 55 | } 56 | 57 | dimension: advertiser_id { 58 | type: string 59 | sql: ${TABLE}.advertiserId ;; 60 | } 61 | 62 | dimension: agency_id { 63 | type: string 64 | sql: ${TABLE}.agencyId ;; 65 | } 66 | 67 | dimension: bid_strategy_inherited { 68 | type: yesno 69 | sql: ${TABLE}.bidStrategyInherited ;; 70 | } 71 | 72 | dimension: bing_ads_budget_type { 73 | type: string 74 | sql: ${TABLE}.bingAdsBudgetType ;; 75 | } 76 | 77 | dimension: campaign { 78 | type: string 79 | sql: ${TABLE}.campaign ;; 80 | link: { 81 | url: "/dashboards/block_sa360_v2::campaign_performance?Campaign={{ value | encode_uri }}" 82 | label: "Campaign Performance Dashboard" 83 | } 84 | link: { 85 | url: "https://searchads.google.com/ds/cm/cm?#adgroups.ay={{ campaign.agency_id._value }};av={{ campaign.advertiser_id._value }};ea={{ account.account_engine_id._value }};c={{ campaign.campaign_id._value }}" 86 | label: "View on SA360" 87 | icon_url: "https://storage.googleapis.com/support-kms-prod/kNxlBgSkVI3TZFe77PovWkoh0P9K7Vw1ovEJ" 88 | } 89 | } 90 | 91 | dimension_group: campaign_end { 92 | type: time 93 | timeframes: [ 94 | raw, 95 | date, 96 | week, 97 | month, 98 | quarter, 99 | year 100 | ] 101 | convert_tz: no 102 | datatype: date 103 | sql: ${TABLE}.campaignEndDate ;; 104 | } 105 | 106 | dimension: is_active_now { 107 | type: yesno 108 | sql: ${campaign_end_date} >= CURRENT_DATE() ;; 109 | } 110 | 111 | dimension: campaign_engine_id { 112 | description: "ID of the campaign in the external engine account." 113 | type: string 114 | sql: ${TABLE}.campaignEngineId ;; 115 | } 116 | 117 | dimension: campaign_id { 118 | type: string 119 | sql: ${TABLE}.campaignId ;; 120 | } 121 | 122 | dimension: campaign_labels { 123 | type: string 124 | sql: ${TABLE}.campaignLabels ;; 125 | } 126 | 127 | dimension: campaign_mobile_bid_adjustment { 128 | type: number 129 | sql: ${TABLE}.campaignMobileBidAdjustment ;; 130 | } 131 | 132 | dimension_group: campaign_start { 133 | type: time 134 | timeframes: [ 135 | raw, 136 | date, 137 | week, 138 | month, 139 | quarter, 140 | year 141 | ] 142 | convert_tz: no 143 | datatype: date 144 | sql: ${TABLE}.campaignStartDate ;; 145 | } 146 | 147 | dimension: weeks_since_campaign_start { 148 | label: "Weeks Since Campaign Start" 149 | type: number 150 | sql: DATE_DIFF(CURRENT_DATE(), ${campaign_start_date}, WEEK) ;; 151 | } 152 | 153 | dimension: campaign_type { 154 | type: string 155 | sql: ${TABLE}.campaignType ;; 156 | } 157 | 158 | dimension: city_targets { 159 | group_label: "Targets" 160 | type: string 161 | sql: ${TABLE}.cityTargets ;; 162 | } 163 | 164 | dimension: country_targets { 165 | group_label: "Targets" 166 | type: string 167 | sql: ${TABLE}.countryTargets ;; 168 | } 169 | 170 | dimension_group: creation { 171 | type: time 172 | timeframes: [ 173 | raw, 174 | time, 175 | date, 176 | week, 177 | month, 178 | quarter, 179 | year 180 | ] 181 | sql: ${TABLE}.creationTimestamp ;; 182 | } 183 | 184 | dimension: daily_budget { 185 | value_format_name: usd 186 | type: number 187 | sql: ${TABLE}.dailyBudget ;; 188 | } 189 | 190 | dimension: delivery_method { 191 | type: string 192 | sql: ${TABLE}.deliveryMethod ;; 193 | } 194 | 195 | dimension: device_targets { 196 | group_label: "Targets" 197 | type: string 198 | sql: ${TABLE}.deviceTargets ;; 199 | } 200 | 201 | dimension: effective_bid_strategy_id { 202 | type: string 203 | sql: ${TABLE}.effectiveBidStrategyId ;; 204 | } 205 | 206 | dimension: effective_city_targets { 207 | group_label: "Targets" 208 | type: string 209 | sql: ${TABLE}.effectiveCityTargets ;; 210 | } 211 | 212 | dimension: effective_country_targets { 213 | group_label: "Targets" 214 | type: string 215 | sql: ${TABLE}.effectiveCountryTargets ;; 216 | } 217 | 218 | dimension: effective_device_targets { 219 | group_label: "Targets" 220 | type: string 221 | sql: ${TABLE}.effectiveDeviceTargets ;; 222 | } 223 | 224 | dimension: effective_labels { 225 | type: string 226 | sql: ${TABLE}.effectiveLabels ;; 227 | } 228 | 229 | dimension: effective_metro_targets { 230 | group_label: "Targets" 231 | type: string 232 | sql: ${TABLE}.effectiveMetroTargets ;; 233 | } 234 | 235 | dimension: effective_province_targets { 236 | group_label: "Targets" 237 | type: string 238 | sql: ${TABLE}.effectiveProvinceTargets ;; 239 | } 240 | 241 | dimension: engine_status { 242 | description: "Additional status of the campaign in the external engine account." 243 | type: string 244 | sql: ${TABLE}.engineStatus ;; 245 | } 246 | 247 | dimension: excluded_city_targets { 248 | group_label: "Targets" 249 | type: string 250 | sql: ${TABLE}.excludedCityTargets ;; 251 | } 252 | 253 | dimension: excluded_country_targets { 254 | group_label: "Targets" 255 | type: string 256 | sql: ${TABLE}.excludedCountryTargets ;; 257 | } 258 | 259 | dimension: excluded_metro_targets { 260 | group_label: "Targets" 261 | type: string 262 | sql: ${TABLE}.excludedMetroTargets ;; 263 | } 264 | 265 | dimension: excluded_province_targets { 266 | group_label: "Targets" 267 | type: string 268 | sql: ${TABLE}.excludedProvinceTargets ;; 269 | } 270 | 271 | dimension: is_keyword_near_match_enabled { 272 | type: yesno 273 | sql: CASE WHEN ${TABLE}.keywordNearMatchEnabled = 'Enabled' THEN TRUE ELSE FALSE END;; 274 | } 275 | 276 | dimension: language_targets { 277 | group_label: "Targets" 278 | type: string 279 | sql: ${TABLE}.languageTargets ;; 280 | } 281 | 282 | dimension_group: last_modified { 283 | type: time 284 | timeframes: [ 285 | raw, 286 | time, 287 | date, 288 | week, 289 | month, 290 | quarter, 291 | year 292 | ] 293 | sql: ${TABLE}.lastModifiedTimestamp ;; 294 | } 295 | 296 | dimension: metro_targets { 297 | group_label: "Targets" 298 | type: string 299 | sql: ${TABLE}.metroTargets ;; 300 | } 301 | 302 | dimension: monthly_budget { 303 | type: number 304 | value_format_name: usd 305 | sql: ${TABLE}.monthlyBudget ;; 306 | } 307 | 308 | measure: average_monthly_budget { 309 | type: average 310 | value_format_name: usd 311 | sql: ${monthly_budget} ;; 312 | } 313 | 314 | measure: total_monthly_budget { 315 | type: sum 316 | value_format_name: usd 317 | sql: ${monthly_budget} ;; 318 | } 319 | 320 | dimension: network_target { 321 | group_label: "Targets" 322 | type: string 323 | sql: ${TABLE}.networkTarget ;; 324 | } 325 | 326 | dimension: province_targets { 327 | group_label: "Targets" 328 | type: string 329 | sql: ${TABLE}.provinceTargets ;; 330 | } 331 | 332 | dimension: status { 333 | type: string 334 | sql: ${TABLE}.status ;; 335 | } 336 | 337 | dimension: yahoo_geo_targets { 338 | group_label: "Targets" 339 | type: string 340 | sql: ${TABLE}.yahooGeoTargets ;; 341 | } 342 | 343 | dimension: yahoo_japan_bid_strategy { 344 | type: string 345 | sql: ${TABLE}.yahooJapanBidStrategy ;; 346 | } 347 | 348 | measure: count { 349 | type: count 350 | drill_fields: [] 351 | } 352 | } -------------------------------------------------------------------------------- /views/product.view.lkml: -------------------------------------------------------------------------------- 1 | view: product { 2 | sql_table_name: `@{SA_360_SCHEMA}.ProductAdvertised_@{ADVERTISER_ID}` 3 | ;; 4 | 5 | dimension: product_composite_key { 6 | hidden: yes 7 | primary_key: yes 8 | sql: ${product_id} || ' ' || ${_data_date} ;; 9 | } 10 | 11 | dimension_group: _data { 12 | type: time 13 | timeframes: [ 14 | raw, 15 | date, 16 | week, 17 | month, 18 | quarter, 19 | year 20 | ] 21 | convert_tz: no 22 | datatype: date 23 | sql: ${TABLE}._DATA_DATE ;; 24 | } 25 | 26 | dimension_group: _latest { 27 | hidden: yes 28 | type: time 29 | timeframes: [ 30 | raw, 31 | date, 32 | week, 33 | month, 34 | quarter, 35 | year 36 | ] 37 | convert_tz: no 38 | datatype: date 39 | sql: ${TABLE}._LATEST_DATE ;; 40 | } 41 | 42 | dimension: advertiser_id { 43 | type: string 44 | sql: ${TABLE}.advertiserId ;; 45 | } 46 | 47 | dimension: agency_id { 48 | type: string 49 | sql: ${TABLE}.agencyId ;; 50 | } 51 | 52 | dimension_group: creation { 53 | type: time 54 | timeframes: [ 55 | raw, 56 | time, 57 | date, 58 | week, 59 | month, 60 | quarter, 61 | year 62 | ] 63 | sql: ${TABLE}.creationTimestamp ;; 64 | } 65 | 66 | dimension_group: last_modified { 67 | type: time 68 | timeframes: [ 69 | raw, 70 | time, 71 | date, 72 | week, 73 | month, 74 | quarter, 75 | year 76 | ] 77 | sql: ${TABLE}.lastModifiedTimestamp ;; 78 | } 79 | 80 | dimension: product_age_group { 81 | label: "Age Group" 82 | type: string 83 | sql: ${TABLE}.productAgeGroup ;; 84 | } 85 | 86 | dimension: product_availability { 87 | label: "Availability" 88 | type: string 89 | sql: ${TABLE}.productAvailability ;; 90 | } 91 | 92 | dimension: product_brand { 93 | label: "Brand" 94 | type: string 95 | sql: ${TABLE}.productBrand ;; 96 | } 97 | 98 | dimension: product_category { 99 | label: "Category" 100 | type: string 101 | sql: ${TABLE}.productCategory ;; 102 | } 103 | 104 | dimension: product_category_level1 { 105 | label: "Level 1" 106 | group_label: "Category Levels" 107 | type: string 108 | sql: ${TABLE}.productCategoryLevel1 ;; 109 | } 110 | 111 | dimension: product_category_level2 { 112 | label: "Level 2" 113 | group_label: "Category Levels" 114 | type: string 115 | sql: ${TABLE}.productCategoryLevel2 ;; 116 | } 117 | 118 | dimension: product_category_level3 { 119 | label: "Level 3" 120 | group_label: "Category Levels" 121 | type: string 122 | sql: ${TABLE}.productCategoryLevel3 ;; 123 | } 124 | 125 | dimension: product_category_level4 { 126 | label: "Level 4" 127 | group_label: "Category Levels" 128 | type: string 129 | sql: ${TABLE}.productCategoryLevel4 ;; 130 | } 131 | 132 | dimension: product_category_level5 { 133 | label: "Level 5" 134 | group_label: "Category Levels" 135 | type: string 136 | sql: ${TABLE}.productCategoryLevel5 ;; 137 | } 138 | 139 | dimension: product_channel { 140 | label: "Channel" 141 | description: "The sales channel attribute of a product item: Online or Local" 142 | type: string 143 | sql: ${TABLE}.productChannel ;; 144 | } 145 | 146 | dimension: product_channel_exclusivity { 147 | label: "Channel Exclusivity" 148 | type: string 149 | sql: ${TABLE}.productChannelExclusivity ;; 150 | } 151 | 152 | dimension: product_color { 153 | label: "Color" 154 | type: string 155 | sql: ${TABLE}.productColor ;; 156 | } 157 | 158 | dimension: product_condition { 159 | label: "Condition" 160 | type: string 161 | sql: ${TABLE}.productCondition ;; 162 | } 163 | 164 | dimension: product_country { 165 | description: "The country registered for the product's inventory feed." 166 | label: "Country" 167 | type: string 168 | map_layer_name: countries 169 | sql: ${TABLE}.productCountry ;; 170 | } 171 | 172 | dimension: product_custom_label0 { 173 | group_label: "Custom Labels" 174 | label: "Label 0" 175 | type: string 176 | sql: ${TABLE}.productCustomLabel0 ;; 177 | } 178 | 179 | dimension: product_custom_label1 { 180 | group_label: "Custom Labels" 181 | label: "Label 1" 182 | type: string 183 | sql: ${TABLE}.productCustomLabel1 ;; 184 | } 185 | 186 | dimension: product_custom_label2 { 187 | group_label: "Custom Labels" 188 | label: "Label 2" 189 | type: string 190 | sql: ${TABLE}.productCustomLabel2 ;; 191 | } 192 | 193 | dimension: product_custom_label3 { 194 | group_label: "Custom Labels" 195 | label: "Label 3" 196 | type: string 197 | sql: ${TABLE}.productCustomLabel3 ;; 198 | } 199 | 200 | dimension: product_custom_label4 { 201 | group_label: "Custom Labels" 202 | label: "Label 4" 203 | type: string 204 | sql: ${TABLE}.productCustomLabel4 ;; 205 | } 206 | 207 | dimension: product_gender { 208 | description: "The gender attribute of a product item." 209 | label: "Gender" 210 | type: string 211 | sql: ${TABLE}.productGender ;; 212 | } 213 | 214 | dimension: product_gtin { 215 | description: "The GTIN attribute (Global Trading Item Number) of a product item." 216 | label: "GTIN" 217 | type: string 218 | sql: ${TABLE}.productGtin ;; 219 | } 220 | 221 | dimension: product_id { 222 | type: string 223 | sql: ${TABLE}.productId ;; 224 | } 225 | 226 | dimension: product_item_group_id { 227 | label: "Item Group ID" 228 | type: string 229 | sql: ${TABLE}.productItemGroupId ;; 230 | } 231 | 232 | dimension: product_landing_page_url { 233 | label: "Landing Page URL" 234 | type: string 235 | sql: ${TABLE}.productLandingPageUrl ;; 236 | } 237 | 238 | dimension: product_language { 239 | label: "Language" 240 | description: "The language registered for the product's inventory feed." 241 | type: string 242 | sql: ${TABLE}.productLanguage ;; 243 | } 244 | 245 | dimension: product_material { 246 | label: "Material" 247 | type: string 248 | sql: ${TABLE}.productMaterial ;; 249 | } 250 | 251 | dimension: product_mpn { 252 | label: "MPN" 253 | description: "The MPN attribute (Manufacturer Part Number) of a product item." 254 | type: string 255 | sql: ${TABLE}.productMpn ;; 256 | } 257 | 258 | dimension: product_pattern { 259 | label: "Pattern" 260 | type: string 261 | sql: ${TABLE}.productPattern ;; 262 | } 263 | 264 | dimension: product_size { 265 | label: "Size" 266 | type: string 267 | sql: ${TABLE}.productSize ;; 268 | } 269 | 270 | dimension: product_store_id { 271 | label: "Store ID" 272 | type: string 273 | sql: ${TABLE}.productStoreId ;; 274 | } 275 | 276 | dimension: product_title { 277 | label: "Title" 278 | type: string 279 | sql: ${TABLE}.productTitle ;; 280 | } 281 | 282 | dimension: product_type_level1 { 283 | group_label: "Type Levels" 284 | label: "Level 1" 285 | type: string 286 | sql: ${TABLE}.productTypeLevel1 ;; 287 | } 288 | 289 | dimension: product_type_level2 { 290 | group_label: "Type Levels" 291 | label: "Level 2" 292 | type: string 293 | sql: ${TABLE}.productTypeLevel2 ;; 294 | } 295 | 296 | dimension: product_type_level3 { 297 | group_label: "Type Levels" 298 | label: "Level 3" 299 | type: string 300 | sql: ${TABLE}.productTypeLevel3 ;; 301 | } 302 | 303 | dimension: product_type_level4 { 304 | group_label: "Type Levels" 305 | label: "Level 4" 306 | type: string 307 | sql: ${TABLE}.productTypeLevel4 ;; 308 | } 309 | 310 | dimension: product_type_level5 { 311 | group_label: "Type Levels" 312 | label: "Level 5" 313 | type: string 314 | sql: ${TABLE}.productTypeLevel5 ;; 315 | } 316 | 317 | dimension: status { 318 | type: string 319 | sql: ${TABLE}.status ;; 320 | } 321 | 322 | measure: count { 323 | type: count 324 | drill_fields: [] 325 | } 326 | 327 | dimension: product_price { 328 | label: "Price" 329 | value_format_name: usd 330 | type: number 331 | sql: ${TABLE}.productPrice ;; 332 | } 333 | 334 | measure: total_price { 335 | value_format_name: usd 336 | type: sum 337 | sql: ${product_price} ;; 338 | } 339 | 340 | measure: average_price { 341 | value_format_name: usd 342 | type: average 343 | sql: ${product_price} ;; 344 | } 345 | 346 | dimension: product_sale_price { 347 | hidden: yes 348 | type: number 349 | value_format_name: usd 350 | sql: ${TABLE}.productSalePrice ;; 351 | } 352 | 353 | dimension: product_cost_of_goods_sold { 354 | label: "Cost of Goods Sold" 355 | type: number 356 | value_format_name: usd 357 | sql: ${TABLE}.productCostOfGoodsSold ;; 358 | } 359 | 360 | measure: total_cost_of_goods_sold { 361 | type: sum 362 | value_format_name: usd 363 | sql: ${product_cost_of_goods_sold} ;; 364 | } 365 | 366 | measure: average_cost_of_goods_sold { 367 | type: average 368 | value_format_name: usd 369 | sql: ${product_cost_of_goods_sold} ;; 370 | } 371 | 372 | dimension: gross_margin { 373 | type: number 374 | value_format_name: usd 375 | sql: ${product_sale_price} - ${product_cost_of_goods_sold} ;; 376 | } 377 | 378 | measure: total_gross_margin { 379 | type: sum 380 | value_format_name: usd 381 | sql: ${gross_margin} ;; 382 | } 383 | 384 | measure: average_gross_margin { 385 | type: average 386 | value_format_name: usd 387 | sql: ${gross_margin} ;; 388 | } 389 | 390 | } 391 | -------------------------------------------------------------------------------- /dashboards/product_analytics.dashboard.lookml: -------------------------------------------------------------------------------- 1 | - dashboard: product_analytics 2 | title: Product Analytics 3 | layout: newspaper 4 | preferred_viewer: dashboards-next 5 | elements: 6 | - title: Total Spend 7 | name: Total Spend 8 | model: block_sa360_v2 9 | explore: product_events 10 | type: single_value 11 | fields: [product_events.total_cost, product_conversion_events.period_selected] 12 | filters: 13 | product_conversion_events.period_selected: "-NULL" 14 | sorts: [product_conversion_events.period_selected desc] 15 | limit: 500 16 | dynamic_fields: [{table_calculation: prior_period, label: Prior Period, expression: "${product_events.total_cost}/offset(${product_events.total_cost},1)-1", 17 | value_format: !!null '', value_format_name: percent_0, _kind_hint: measure, 18 | _type_hint: number}] 19 | query_timezone: America/Los_Angeles 20 | custom_color_enabled: true 21 | show_single_value_title: true 22 | show_comparison: true 23 | comparison_type: change 24 | comparison_reverse_colors: false 25 | show_comparison_label: true 26 | enable_conditional_formatting: false 27 | conditional_formatting_include_totals: false 28 | conditional_formatting_include_nulls: false 29 | defaults_version: 1 30 | listen: 31 | Device: product_conversion_events.device_segment 32 | Brand: product.product_brand 33 | Advertiser: advertiser.advertiser 34 | Engine: account.account_type 35 | Period: product_conversion_events.this_period_filter 36 | Prior Period Comparison: product_conversion_events.prior_period_filter 37 | row: 3 38 | col: 0 39 | width: 4 40 | height: 4 41 | - title: CPA 42 | name: CPA 43 | model: block_sa360_v2 44 | explore: product_events 45 | type: single_value 46 | fields: [product_conversion_events.cost_per_acquisition, product_conversion_events.period_selected] 47 | filters: 48 | product_conversion_events.period_selected: "-NULL" 49 | sorts: [product_conversion_events.period_selected desc] 50 | limit: 500 51 | dynamic_fields: [{table_calculation: prior_period, label: Prior Period, expression: "${product_conversion_events.cost_per_acquisition}/offset(${product_conversion_events.cost_per_acquisition},1)-1", 52 | value_format: !!null '', value_format_name: percent_0, _kind_hint: measure, 53 | _type_hint: number}] 54 | query_timezone: America/Los_Angeles 55 | custom_color_enabled: true 56 | show_single_value_title: true 57 | show_comparison: true 58 | comparison_type: change 59 | comparison_reverse_colors: false 60 | show_comparison_label: true 61 | enable_conditional_formatting: false 62 | conditional_formatting_include_totals: false 63 | conditional_formatting_include_nulls: false 64 | defaults_version: 1 65 | listen: 66 | Device: product_conversion_events.device_segment 67 | Brand: product.product_brand 68 | Advertiser: advertiser.advertiser 69 | Engine: account.account_type 70 | Period: product_conversion_events.this_period_filter 71 | Prior Period Comparison: product_conversion_events.prior_period_filter 72 | row: 7 73 | col: 0 74 | width: 4 75 | height: 4 76 | - title: Total Clicks 77 | name: Total Clicks 78 | model: block_sa360_v2 79 | explore: product_events 80 | type: single_value 81 | fields: [product_events.total_clicks, product_conversion_events.period_selected] 82 | filters: 83 | product_conversion_events.period_selected: "-NULL" 84 | sorts: [product_conversion_events.period_selected desc] 85 | limit: 500 86 | dynamic_fields: [{table_calculation: prior_period, label: Prior Period, expression: "${product_events.total_clicks}/offset(${product_events.total_clicks},1)-1", 87 | value_format: !!null '', value_format_name: percent_0, _kind_hint: measure, 88 | _type_hint: number}] 89 | query_timezone: America/Los_Angeles 90 | custom_color_enabled: true 91 | show_single_value_title: true 92 | show_comparison: true 93 | comparison_type: change 94 | comparison_reverse_colors: false 95 | show_comparison_label: true 96 | enable_conditional_formatting: false 97 | conditional_formatting_include_totals: false 98 | conditional_formatting_include_nulls: false 99 | defaults_version: 1 100 | listen: 101 | Device: product_conversion_events.device_segment 102 | Brand: product.product_brand 103 | Advertiser: advertiser.advertiser 104 | Engine: account.account_type 105 | Period: product_conversion_events.this_period_filter 106 | Prior Period Comparison: product_conversion_events.prior_period_filter 107 | row: 3 108 | col: 8 109 | width: 4 110 | height: 4 111 | - title: CTR 112 | name: CTR 113 | model: block_sa360_v2 114 | explore: product_events 115 | type: single_value 116 | fields: [product_events.click_through_rate, product_conversion_events.period_selected] 117 | filters: 118 | product_conversion_events.period_selected: "-NULL" 119 | sorts: [product_conversion_events.period_selected desc] 120 | limit: 500 121 | dynamic_fields: [{table_calculation: prior_period, label: Prior Period, expression: "${product_events.click_through_rate}/offset(${product_events.click_through_rate},1)-1", 122 | value_format: !!null '', value_format_name: percent_0, _kind_hint: measure, 123 | _type_hint: number}] 124 | query_timezone: America/Los_Angeles 125 | custom_color_enabled: true 126 | show_single_value_title: true 127 | show_comparison: true 128 | comparison_type: change 129 | comparison_reverse_colors: false 130 | show_comparison_label: true 131 | enable_conditional_formatting: false 132 | conditional_formatting_include_totals: false 133 | conditional_formatting_include_nulls: false 134 | defaults_version: 1 135 | listen: 136 | Device: product_conversion_events.device_segment 137 | Brand: product.product_brand 138 | Advertiser: advertiser.advertiser 139 | Engine: account.account_type 140 | Period: product_conversion_events.this_period_filter 141 | Prior Period Comparison: product_conversion_events.prior_period_filter 142 | row: 7 143 | col: 4 144 | width: 4 145 | height: 4 146 | - title: Total Revenue 147 | name: Total Revenue 148 | model: block_sa360_v2 149 | explore: product_events 150 | type: single_value 151 | fields: [product_conversion_events.total_revenue, product_conversion_events.period_selected] 152 | filters: 153 | product_conversion_events.period_selected: "-NULL" 154 | sorts: [product_conversion_events.period_selected desc] 155 | limit: 500 156 | dynamic_fields: [{table_calculation: prior_period, label: Prior Period, expression: "${product_conversion_events.total_revenue}/offset(${product_conversion_events.total_revenue},1)-1", 157 | value_format: !!null '', value_format_name: percent_0, is_disabled: false, 158 | _kind_hint: measure, _type_hint: number}] 159 | query_timezone: America/Los_Angeles 160 | custom_color_enabled: true 161 | show_single_value_title: true 162 | show_comparison: true 163 | comparison_type: change 164 | comparison_reverse_colors: false 165 | show_comparison_label: true 166 | enable_conditional_formatting: false 167 | conditional_formatting_include_totals: false 168 | conditional_formatting_include_nulls: false 169 | defaults_version: 1 170 | listen: 171 | Device: product_conversion_events.device_segment 172 | Brand: product.product_brand 173 | Advertiser: advertiser.advertiser 174 | Engine: account.account_type 175 | Period: product_conversion_events.this_period_filter 176 | Prior Period Comparison: product_conversion_events.prior_period_filter 177 | row: 3 178 | col: 4 179 | width: 4 180 | height: 4 181 | - title: Highest Earning Products 182 | name: Highest Earning Products 183 | model: block_sa360_v2 184 | explore: product_events 185 | type: looker_grid 186 | fields: [product.product_title, product.product_brand, product_conversion_events.total_revenue, 187 | product_conversion_events.ROAS, product_events.total_cost] 188 | sorts: [product_conversion_events.total_revenue desc] 189 | limit: 500 190 | column_limit: 50 191 | show_view_names: false 192 | show_row_numbers: true 193 | transpose: false 194 | truncate_text: true 195 | hide_totals: false 196 | hide_row_totals: false 197 | size_to_fit: true 198 | table_theme: white 199 | limit_displayed_rows: true 200 | enable_conditional_formatting: true 201 | header_text_alignment: left 202 | header_font_size: '12' 203 | rows_font_size: '12' 204 | conditional_formatting_include_totals: false 205 | conditional_formatting_include_nulls: false 206 | show_sql_query_menu_options: false 207 | show_totals: true 208 | show_row_totals: true 209 | series_cell_visualizations: 210 | product_conversion_events.total_revenue: 211 | is_active: false 212 | product_conversion_events.ROAS: 213 | is_active: false 214 | limit_displayed_rows_values: 215 | show_hide: show 216 | first_last: first 217 | num_rows: '10' 218 | conditional_formatting: [{type: along a scale..., value: !!null '', background_color: "#4285F4", 219 | font_color: !!null '', color_application: {collection_id: google, custom: { 220 | id: 7d8b6bb1-8aed-bb41-b45c-2a865bd98aca, label: Custom, type: continuous, 221 | stops: [{color: "#B31412", offset: 0}, {color: "#EA4335", offset: 25}, 222 | {color: "#ffffff", offset: 50}, {color: "#79f57f", offset: 75}, {color: "#05bd1b", 223 | offset: 100}]}, options: {steps: 5, constraints: {min: {type: minimum}, 224 | mid: {type: number, value: 0}, max: {type: maximum}}, mirror: true, 225 | reverse: false, stepped: false}}, bold: false, italic: false, strikethrough: false, 226 | fields: [product_conversion_events.total_revenue]}] 227 | x_axis_gridlines: false 228 | y_axis_gridlines: true 229 | show_y_axis_labels: true 230 | show_y_axis_ticks: true 231 | y_axis_tick_density: default 232 | y_axis_tick_density_custom: 5 233 | show_x_axis_label: true 234 | show_x_axis_ticks: true 235 | y_axis_scale_mode: linear 236 | x_axis_reversed: false 237 | y_axis_reversed: false 238 | plot_size_by_field: false 239 | trellis: '' 240 | stacking: '' 241 | legend_position: center 242 | point_style: none 243 | show_value_labels: false 244 | label_density: 25 245 | x_axis_scale: auto 246 | y_axis_combined: true 247 | ordering: none 248 | show_null_labels: false 249 | show_totals_labels: false 250 | show_silhouette: false 251 | totals_color: "#808080" 252 | defaults_version: 1 253 | series_types: {} 254 | series_column_widths: 255 | product.product_title: 314 256 | product.product_brand: 127 257 | listen: 258 | Device: product_conversion_events.device_segment 259 | Brand: product.product_brand 260 | Advertiser: advertiser.advertiser 261 | Engine: account.account_type 262 | Period: product_conversion_events.this_period_filter 263 | Prior Period Comparison: product_conversion_events.prior_period_filter 264 | row: 14 265 | col: 9 266 | width: 15 267 | height: 6 268 | - title: Total Spend vs Total Revenue 269 | name: Total Spend vs Total Revenue 270 | model: block_sa360_v2 271 | explore: product_events 272 | type: looker_line 273 | fields: [product_events.total_cost, product_conversion_events.total_revenue, product_conversion_events.days_from_period_start] 274 | filters: {} 275 | sorts: [product_events.total_cost desc] 276 | limit: 500 277 | column_limit: 50 278 | x_axis_gridlines: false 279 | y_axis_gridlines: true 280 | show_view_names: false 281 | show_y_axis_labels: true 282 | show_y_axis_ticks: true 283 | y_axis_tick_density: default 284 | y_axis_tick_density_custom: 5 285 | show_x_axis_label: true 286 | show_x_axis_ticks: true 287 | y_axis_scale_mode: linear 288 | x_axis_reversed: false 289 | y_axis_reversed: false 290 | plot_size_by_field: false 291 | trellis: '' 292 | stacking: '' 293 | limit_displayed_rows: false 294 | legend_position: center 295 | point_style: circle_outline 296 | show_value_labels: false 297 | label_density: 25 298 | x_axis_scale: auto 299 | y_axis_combined: true 300 | show_null_points: false 301 | interpolation: monotone 302 | series_types: {} 303 | defaults_version: 1 304 | listen: 305 | Device: product_conversion_events.device_segment 306 | Brand: product.product_brand 307 | Advertiser: advertiser.advertiser 308 | Engine: account.account_type 309 | Period: product_conversion_events.this_period_filter 310 | Prior Period Comparison: product_conversion_events.prior_period_filter 311 | row: 14 312 | col: 0 313 | width: 9 314 | height: 6 315 | - title: Revenue by Product Country 316 | name: Revenue by Product Country 317 | model: block_sa360_v2 318 | explore: product_events 319 | type: looker_geo_choropleth 320 | fields: [product.product_country, product_conversion_events.total_revenue] 321 | sorts: [product_conversion_events.total_revenue desc] 322 | limit: 500 323 | column_limit: 50 324 | map: auto 325 | map_projection: '' 326 | show_view_names: false 327 | quantize_colors: true 328 | map_plot_mode: points 329 | heatmap_gridlines: false 330 | heatmap_gridlines_empty: false 331 | heatmap_opacity: 0.5 332 | show_region_field: true 333 | draw_map_labels_above_data: true 334 | map_tile_provider: light 335 | map_position: custom 336 | map_scale_indicator: 'off' 337 | map_pannable: true 338 | map_zoomable: true 339 | map_marker_type: circle 340 | map_marker_icon_name: default 341 | map_marker_radius_mode: proportional_value 342 | map_marker_units: meters 343 | map_marker_proportional_scale_type: linear 344 | map_marker_color_mode: fixed 345 | show_legend: true 346 | quantize_map_value_colors: false 347 | reverse_map_value_colors: true 348 | map_latitude: 45.519819502877084 349 | map_longitude: -145.05249023437503 350 | map_zoom: 2 351 | defaults_version: 1 352 | series_types: {} 353 | listen: 354 | Device: product_conversion_events.device_segment 355 | Brand: product.product_brand 356 | Advertiser: advertiser.advertiser 357 | Engine: account.account_type 358 | Period: product_conversion_events.this_period_filter 359 | Prior Period Comparison: product_conversion_events.prior_period_filter 360 | row: 20 361 | col: 0 362 | width: 12 363 | height: 7 364 | - title: ROAS 365 | name: ROAS 366 | model: block_sa360_v2 367 | explore: product_events 368 | type: single_value 369 | fields: [product_conversion_events.ROAS, product_conversion_events.period_selected] 370 | filters: 371 | product_conversion_events.period_selected: "-NULL" 372 | sorts: [product_conversion_events.period_selected desc] 373 | limit: 500 374 | dynamic_fields: [{table_calculation: prior_period, label: Prior Period, expression: "${product_conversion_events.ROAS}/offset(${product_conversion_events.ROAS},1)-1", 375 | value_format: !!null '', value_format_name: percent_0, _kind_hint: measure, 376 | _type_hint: number}] 377 | query_timezone: America/Los_Angeles 378 | custom_color_enabled: true 379 | show_single_value_title: true 380 | show_comparison: true 381 | comparison_type: change 382 | comparison_reverse_colors: false 383 | show_comparison_label: true 384 | enable_conditional_formatting: false 385 | conditional_formatting_include_totals: false 386 | conditional_formatting_include_nulls: false 387 | defaults_version: 1 388 | listen: 389 | Device: product_conversion_events.device_segment 390 | Brand: product.product_brand 391 | Advertiser: advertiser.advertiser 392 | Engine: account.account_type 393 | Period: product_conversion_events.this_period_filter 394 | Prior Period Comparison: product_conversion_events.prior_period_filter 395 | row: 7 396 | col: 8 397 | width: 4 398 | height: 4 399 | - title: Conversion Rate 400 | name: Conversion Rate 401 | model: block_sa360_v2 402 | explore: product_events 403 | type: single_value 404 | fields: [product_conversion_events.conversion_rate, product_conversion_events.period_selected] 405 | filters: 406 | product_conversion_events.period_selected: "-NULL" 407 | sorts: [product_conversion_events.period_selected desc] 408 | limit: 500 409 | dynamic_fields: [{table_calculation: prior_period, label: Prior Period, expression: "${product_conversion_events.conversion_rate}/offset(${product_conversion_events.conversion_rate},1)-1", 410 | value_format: !!null '', value_format_name: percent_0, _kind_hint: measure, 411 | _type_hint: number}] 412 | query_timezone: America/Los_Angeles 413 | custom_color_enabled: true 414 | show_single_value_title: true 415 | show_comparison: true 416 | comparison_type: change 417 | comparison_reverse_colors: false 418 | show_comparison_label: true 419 | enable_conditional_formatting: false 420 | conditional_formatting_include_totals: false 421 | conditional_formatting_include_nulls: false 422 | x_axis_gridlines: false 423 | y_axis_gridlines: true 424 | show_view_names: false 425 | show_y_axis_labels: true 426 | show_y_axis_ticks: true 427 | y_axis_tick_density: default 428 | y_axis_tick_density_custom: 5 429 | show_x_axis_label: true 430 | show_x_axis_ticks: true 431 | y_axis_scale_mode: linear 432 | x_axis_reversed: false 433 | y_axis_reversed: false 434 | plot_size_by_field: false 435 | trellis: '' 436 | stacking: '' 437 | limit_displayed_rows: false 438 | legend_position: center 439 | point_style: none 440 | show_value_labels: false 441 | label_density: 25 442 | x_axis_scale: auto 443 | y_axis_combined: true 444 | show_null_points: true 445 | interpolation: linear 446 | defaults_version: 1 447 | series_types: {} 448 | listen: 449 | Device: product_conversion_events.device_segment 450 | Brand: product.product_brand 451 | Advertiser: advertiser.advertiser 452 | Engine: account.account_type 453 | Period: product_conversion_events.this_period_filter 454 | Prior Period Comparison: product_conversion_events.prior_period_filter 455 | row: 7 456 | col: 12 457 | width: 4 458 | height: 4 459 | - title: New Tile 460 | name: New Tile 461 | model: block_sa360_v2 462 | explore: product_events 463 | type: looker_column 464 | fields: [product_events.total_impressions, product_events.total_clicks, product_conversion_events.total_conversions] 465 | limit: 500 466 | query_timezone: America/Los_Angeles 467 | x_axis_gridlines: false 468 | y_axis_gridlines: true 469 | show_view_names: false 470 | show_y_axis_labels: true 471 | show_y_axis_ticks: true 472 | y_axis_tick_density: default 473 | y_axis_tick_density_custom: 5 474 | show_x_axis_label: true 475 | show_x_axis_ticks: true 476 | y_axis_scale_mode: linear 477 | x_axis_reversed: false 478 | y_axis_reversed: false 479 | plot_size_by_field: false 480 | trellis: '' 481 | stacking: '' 482 | limit_displayed_rows: false 483 | legend_position: center 484 | point_style: none 485 | show_value_labels: false 486 | label_density: 25 487 | x_axis_scale: auto 488 | y_axis_combined: true 489 | ordering: none 490 | show_null_labels: false 491 | show_totals_labels: false 492 | show_silhouette: false 493 | totals_color: "#808080" 494 | show_dropoff: true 495 | defaults_version: 1 496 | title_hidden: true 497 | listen: 498 | Device: product_conversion_events.device_segment 499 | Brand: product.product_brand 500 | Advertiser: advertiser.advertiser 501 | Engine: account.account_type 502 | Period: product_conversion_events.this_period_filter 503 | Prior Period Comparison: product_conversion_events.prior_period_filter 504 | row: 3 505 | col: 16 506 | width: 8 507 | height: 8 508 | - title: Total Conversions 509 | name: Total Conversions 510 | model: block_sa360_v2 511 | explore: product_events 512 | type: single_value 513 | fields: [product_conversion_events.total_conversions, product_conversion_events.period_selected] 514 | filters: 515 | product_conversion_events.period_selected: "-NULL" 516 | sorts: [product_conversion_events.period_selected desc] 517 | limit: 500 518 | dynamic_fields: [{table_calculation: prior_period, label: Prior Period, expression: "${product_conversion_events.total_conversions}/offset(${product_conversion_events.total_conversions},1)-1", 519 | value_format: !!null '', value_format_name: percent_0, _kind_hint: measure, 520 | _type_hint: number}] 521 | query_timezone: America/Los_Angeles 522 | custom_color_enabled: true 523 | show_single_value_title: true 524 | show_comparison: true 525 | comparison_type: change 526 | comparison_reverse_colors: false 527 | show_comparison_label: true 528 | enable_conditional_formatting: false 529 | conditional_formatting_include_totals: false 530 | conditional_formatting_include_nulls: false 531 | x_axis_gridlines: false 532 | y_axis_gridlines: true 533 | show_view_names: false 534 | show_y_axis_labels: true 535 | show_y_axis_ticks: true 536 | y_axis_tick_density: default 537 | y_axis_tick_density_custom: 5 538 | show_x_axis_label: true 539 | show_x_axis_ticks: true 540 | y_axis_scale_mode: linear 541 | x_axis_reversed: false 542 | y_axis_reversed: false 543 | plot_size_by_field: false 544 | trellis: '' 545 | stacking: '' 546 | limit_displayed_rows: false 547 | legend_position: center 548 | point_style: none 549 | show_value_labels: false 550 | label_density: 25 551 | x_axis_scale: auto 552 | y_axis_combined: true 553 | show_null_points: true 554 | interpolation: linear 555 | defaults_version: 1 556 | series_types: {} 557 | listen: 558 | Device: product_conversion_events.device_segment 559 | Brand: product.product_brand 560 | Advertiser: advertiser.advertiser 561 | Engine: account.account_type 562 | Period: product_conversion_events.this_period_filter 563 | Prior Period Comparison: product_conversion_events.prior_period_filter 564 | row: 3 565 | col: 12 566 | width: 4 567 | height: 4 568 | - name: Product Performance 569 | type: text 570 | title_text: Product Performance 571 | subtitle_text: Review how your Products are performing overall. 572 | body_text: |- 573 |