Solved

Why isn't this formula working to match event names?

  • 21 February 2024
  • 1 reply
  • 48 views

Userlevel 3
Badge +2

I’m trying to create a derived property that has a value based on event name. If it ends in “Viewed”, it is a “Pageview”, ends in “Clicked” it’s a Click.  Otherwise it’s Other.

What am I doing wrong in this?

 

icon

Best answer by trevin-bc 21 February 2024, 06:55

View original

1 reply

Userlevel 3
Badge +2

I figured this out!  the regex wasn’t matching correctly.  The correct formula is:

 

SWITCH(
REGEXEXTRACT(
PROPERTY(
'event_type_value',
'event'
),
'(Viewed|Clicked)$'
),
'Viewed',
'Pageview',
'Clicked',
'Click'
)

 

Reply