Skip to content

Commit

Permalink
add revenue
Browse files Browse the repository at this point in the history
  • Loading branch information
emre committed Mar 31, 2021
1 parent 7579d38 commit c4fc5ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions common.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ local predefined = import 'predefined.jsonnet';
},
traffic_source_source: {
type: 'string',
label: 'Traffic Source Channel',
category: 'Event',
sql: '`traffic_source`.`source`',
},
Expand Down
4 changes: 2 additions & 2 deletions custom_events.models.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ std.map(function(event_type)
{
name: 'firebase_event_' + event_type,
label: (if defined != null then '[Firebase] ' else '') + event_type,
measures: common.measures + if defined != null && std.objectHas(defined, 'measures') then defined.measures else {},
measures: common.measures + common.all_events_revenue_measures + if defined != null && std.objectHas(defined, 'measures') then defined.measures else {},
mappings: common.mappings,
category: 'Firebase Events',
relations: common.relations + if defined != null && std.objectHas(defined, 'relations') then defined.relations else {},
sql: |||
SELECT * FROM `%(project)s`.`%(dataset)s`.`events_*`
{%% if partitioned %%} WHERE event_name = '%(event)s' AND _TABLE_SUFFIX BETWEEN FORMAT_DATE("%%Y%%m%%d", DATE '{{date.start}}') and FORMAT_DATE("%%Y%%m%%d", DATE '{{date.end}}') {%% endif %%}
WHERE event_name = '%(event)s' {%% if partitioned %%} AND _TABLE_SUFFIX BETWEEN FORMAT_DATE("%%Y%%m%%d", DATE '{{date.start}}') and FORMAT_DATE("%%Y%%m%%d", DATE '{{date.end}}') {%% endif %%}
%(intraday_query)s
||| % {
project: target.database,
Expand Down

0 comments on commit c4fc5ad

Please sign in to comment.