Skip to content

Commit

Permalink
use utm parameters also if gclid is found (#94)
Browse files Browse the repository at this point in the history
* use utm parameters also if gclid is found

* update location of service json to absolute path of working directory

* updating version

Co-authored-by: Adam Ribaudo <[email protected]>
  • Loading branch information
clemens7haar and adamribaudo-velir authored Nov 24, 2022
1 parent d1f8da0 commit d18a9cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'ga4'
version: '0.1.4'
version: '2.0.1'
config-version: 2
model-paths: ["models"]
analysis-paths: ["analyses"]
Expand Down
10 changes: 7 additions & 3 deletions models/staging/ga4/stg_ga4__events.sql
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,17 @@ include_event_key as (
),
detect_gclid as (
select
* except (medium, campaign),
* except (source, medium, campaign),
case
when page_location like '%gclid%' then "cpc"
when (page_location like '%gclid%' and source is null) then "google"
else source
end as source,
case
when (page_location like '%gclid%' and medium is null) then "cpc"
else medium
end as medium,
case
when page_location like '%gclid%' then "(cpc)"
when (page_location like '%gclid%' and campaign is null) then "(cpc)"
else campaign
end as campaign
from include_event_key
Expand Down

0 comments on commit d18a9cd

Please sign in to comment.