content-groups
Content Groups
Define URL-rule based content groups on one property and measure how each group performs, so the user sees which parts of the site carry the organic traffic and which pages fall outside every group. The user's request may contain a property, a date range, a focus hint (a folder, a group name, "propose groups"), or an instruction to create, edit or delete a group; honor it when present.
Workflow
-
Resolve the property. If the user's request or the conversation names a property, use it. Site URLs use GSC formats:
sc-domain:example.comorhttps://www.example.com/. Otherwise calllist_sitesand pick the obvious match. If several plausible properties exist, ask the user which one before continuing. Use the last 28 days compared with the previous period unless the user specifies dates. GSC data lags about 2 to 3 days: never treat the most recent 2 days as complete, and if a dip appears at the very edge of the range, say it is likely reporting lag, not a real drop. -
Read the saved groups. Call
list_content_groupswithsiteUrland read:groups: each entry carriesid,name,description,rules,colorandcreated_at, sorted by name;- the order caveat: that list is a display order only. When the groups are measured, matching is first-match-wins with the newest group evaluated first, so a page that matches two groups counts in the newer one;
emptyBecause: the property has no groups yet. Continue with step 3 and propose groups instead of measuring.
-
Propose groups from the site's structure. Call
breakdown_by_pathwithsiteUrlanddepth: 1(host plus first folder; raisedepthto 2, at most 4, when one folder holds most of the traffic and the user wants it split). Omit the dates for the last 28 settled days;limitdefaults to 100 (max 1000). Each row ingroupshaspath,host,subdomain,clicks,impressions,ctr,avgPositionandpageCount, sorted by clicks. Quote the property totals fromcoverage.siteTotals, never from summed rows, and relaytruncationNotewhentruncatedis true (on the live-API path the least-clicked pages are missing from every group). Turn the folders and subdomains that carry meaningful clicks into proposed groups, one rule each. A rule is a{ "type", "value" }object and a group takes 1 to 50 of them:prefixwith the full URL start, for example{ "type": "prefix", "value": "https://www.example.com/blog/" }, for a folder or subdomain;containsfor a token anywhere in the URL, such as a locale segment or a query parameter;equalsfor one exact page;regexfor a pattern, in RE2 syntax (no lookahead, lookbehind or backreferences).