ga4_cohort_retention
Calculates weekly or monthly retention of first-time GA4 users by cohort, showing active users and the share retained in each following period.
Instructions
Weekly or monthly retention of first-time users: one cohort per week (or month) of first visit, with active users in each following period and the share retained. Requires: Google Analytics Data API (analyticsdata.googleapis.com) enabled on the quota project; Lector (Viewer) en la propiedad de GA4. If it fails for access, the error explains how to fix it; ga4_check_access checks everything at once.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cohorts | No | Number of consecutive cohorts | |
| periods | No | How many periods after the first to follow | |
| property | No | Saved property name (see ga4_list_properties). Defaults to the default property. | |
| start_date | Yes | Start of the first cohort, YYYY-MM-DD (a Monday for weekly) | |
| granularity | No | WEEKLY |