diff --git a/frontend/src/scenes/actions/actionEditLogic.tsx b/frontend/src/scenes/actions/actionEditLogic.tsx index aa23ec1550b51..10ebc3853272a 100644 --- a/frontend/src/scenes/actions/actionEditLogic.tsx +++ b/frontend/src/scenes/actions/actionEditLogic.tsx @@ -75,11 +75,21 @@ export const actionEditLogic = kea([ submit: async (updatedAction, breakpoint) => { let action: ActionType + // Remove URL from steps if it's not an autocapture or a pageview + let updatedSteps = updatedAction.steps + if (updatedSteps !== undefined) { + updatedSteps = updatedSteps.map((step) => ({ + ...step, + ...(step.event === '$autocapture' || step.event === '$pageview' + ? {} + : { url: null, url_matching: null }), + })) + } try { if (updatedAction.id) { - action = await api.actions.update(updatedAction.id, updatedAction) + action = await api.actions.update(updatedAction.id, { ...updatedAction, steps: updatedSteps }) } else { - action = await api.actions.create(updatedAction) + action = await api.actions.create({ ...updatedAction, steps: updatedSteps }) } breakpoint() } catch (response: any) { diff --git a/posthog/hogql/property.py b/posthog/hogql/property.py index 1fcbf47372016..55a9b335ff6c4 100644 --- a/posthog/hogql/property.py +++ b/posthog/hogql/property.py @@ -590,6 +590,7 @@ def action_to_expr(action: Action) -> ast.Expr: {"value": ast.Constant(value=value)}, ) ) + if step.url: if step.url_matching == "exact": expr = parse_expr(