Repository navigation
v0.45.0
GA4 audiences can now be built from pages and from sequences, not only from events. That covers the most common remarketing list there is: people who looked at the pricing page and did not sign up.
Pages
draft_ga4_audience takes include_pages and exclude_pages. A page matches when its full URL contains the text, without regard to upper and lower case, so /pricing also matches /pricing/enterprise and /en/pricing.
- Pricing page visitors who did not sign up:
include_pages=["/pricing"],exclude_events=["sign_up"]. - Everyone except people who reached the thank-you page:
include_events=["session_start"],exclude_pages=["/thank-you"].
Pages and events in the same list are "any of". On a site with several languages, pass every variant of the page (["/pricing", "/preise"]).
Sequences
sequence takes 2 to 10 steps that a user has to do in this order. A step is an event name or {"page": "/pricing"}, optionally with directly_followed (no other event in between) and within_minutes (time since the step before):
sequence=[{"page": "/pricing"}, {"event": "begin_checkout", "within_minutes": 30}]
Exclusions work as before, so "started checkout after the pricing page, but did not buy" is one audience. A sequence replaces include_events and include_pages; when the order does not matter, an include plus an exclude is the simpler choice and fills faster.
Reading them back
list_ga4_audiences shows these audiences in the same terms (include_pages, exclude_pages, sequence). Audiences built in GA4's editor with other conditions are still listed with their raw conditions.
Worth knowing
- Page conditions are built on GA4's
page_viewevent and itspage_locationparameter. - As before, GA4 fixes an audience's conditions and membership duration at creation. The preview says so, and explains how the page match works, before anything is created.