Skip to content

Instantly share code, notes, and snippets.

@robhammond
Last active July 10, 2018 11:23
Show Gist options
  • Save robhammond/9cd41c5de979c8b1c1a3a8ce04cd05e3 to your computer and use it in GitHub Desktop.
Save robhammond/9cd41c5de979c8b1c1a3a8ce04cd05e3 to your computer and use it in GitHub Desktop.

Revisions

  1. robhammond revised this gist Jul 10, 2018. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions Custom Page Type - Data Studio.js
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    CASE
    WHEN REGEXP_MATCH(Landing Page,"/all-about/") THEN "Topic"
    WHEN REGEXP_MATCH(Landing Page,"-[0-9]+$") THEN "Article"
    WHEN REGEXP_MATCH(Landing Page,"[^/]+/[^/]+/$") THEN "Section"
    WHEN REGEXP_MATCH(Landing Page,"[^/]+/$") THEN "Home"
    WHEN (REGEXP_MATCH(Page/Screen Path (Clean),".*?/all-about/.*?")) THEN "Topic"
    WHEN (REGEXP_MATCH(Page/Screen Path (Clean),".*?-[0-9]+$")) THEN "Article"
    WHEN (REGEXP_MATCH(Page/Screen Path (Clean),"^https?://[^/]+/.*?/$")) THEN "Section"
    WHEN (REGEXP_MATCH(Page/Screen Path (Clean),"^https?://[^/]+/$")) THEN "Home"
    ELSE "(Other)"
    END
  2. robhammond revised this gist Jul 10, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Custom Page Type - Data Studio.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    CASE
    WHEN REGEXP_MATCH(Landing Page,"/all-about/") THEN "Topic"
    WHEN REGEXP_MATCH(Landing Page,"-[0-9]+(\?.*)?$") THEN "Article"
    WHEN REGEXP_MATCH(Landing Page,"-[0-9]+$") THEN "Article"
    WHEN REGEXP_MATCH(Landing Page,"[^/]+/[^/]+/$") THEN "Section"
    WHEN REGEXP_MATCH(Landing Page,"[^/]+/$") THEN "Home"
    ELSE "(Other)"
  3. robhammond created this gist Jul 10, 2018.
    7 changes: 7 additions & 0 deletions Custom Page Type - Data Studio.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    CASE
    WHEN REGEXP_MATCH(Landing Page,"/all-about/") THEN "Topic"
    WHEN REGEXP_MATCH(Landing Page,"-[0-9]+(\?.*)?$") THEN "Article"
    WHEN REGEXP_MATCH(Landing Page,"[^/]+/[^/]+/$") THEN "Section"
    WHEN REGEXP_MATCH(Landing Page,"[^/]+/$") THEN "Home"
    ELSE "(Other)"
    END