Drafts for the next site fix
The lab reads landing-page drop-off and the count of assistant answers it could not find. It drafts a suggestion and cites those numbers. It does not change the site.
GA4 Data API, landing page, last 28 days ending yesterday.
Landing pages
GA4 Data API, landing page, last 28 days ending yesterday.
| Path | Sessions | Bounce rate |
|---|---|---|
| /lab/api | 3 | 1 |
| /lab/utm-builder | 2 | 1 |
| /account | 1 | 1 |
| /lab/heatmap | 1 | 1 |
| /lab/tilt | 1 | 1 |
| /lab/concierge | 9 | 0.8888888888888888 |
A landing page is drafted when sessions are above zero and the bounce rate is at least 0.5 (or 50 when the API returns a percent).
Answers not found
GA4 event answer_shown where chat_status is fallback, last 28 days. The question text is not stored.
This server instance, since it started: 0. A chat answer can land on a different instance, so this number can stay at zero. The question text is not stored.
Drafts
From the signals
Review /lab/api
Look at the first screen and the next link. This draft does not edit the page.
- 3 sessions and a bounce rate of 1 (100%) on this landing page.
From the signals
Review /lab/utm-builder
Look at the first screen and the next link. This draft does not edit the page.
- 2 sessions and a bounce rate of 1 (100%) on this landing page.
From the signals
Review /account
Look at the first screen and the next link. This draft does not edit the page.
- 1 sessions and a bounce rate of 1 (100%) on this landing page.
Pull request
Opening a pull request calls api.github.com only, creates a draft, and does not merge. The canonical git remote for this site is Origin, so a GitHub token opens a GitHub pull request only when IMPROVE_REPO is that GitHub repository. Leave the flag off until that token exists. A person still has to approve the request.
- SELF_IMPROVE_OPEN_PRS=1
- REPO_TOKEN or GITHUB_TOKEN
- IMPROVE_REPO
- GA4_PROPERTY_ID, GA4_CLIENT_EMAIL, GA4_PRIVATE_KEY
The GA4 trio is the same one the Live page uses. The service account needs the Analytics Data API and Viewer on the property. The not-found count also needs the event-scoped dimension chat_status. Question text is not a dimension.
Opening pull requests is off. Set SELF_IMPROVE_OPEN_PRS=1, REPO_TOKEN or GITHUB_TOKEN, IMPROVE_REPO.
Understanding the labHow to use it and why you'd want to
Why you'd want to
You want the site to notice a weak page and a missing answer. The draft cites those counts, and a person still has to approve any change.
How to use it
- Read whether the numbers are an example or from GA4.
- Check the not-found count. The question is absent.
- Leave pull requests off until the flag is set.
WalkthroughHow we built itShowHide
Example vendor setup is marked below. eVar and event numbers are examples. This lab does not call Adobe.
The self-improving lab drafts a page change from landing-page drop-off and from answers the assistant could not find. A pull request stays off unless a flag is set. This page does not call Adobe.
Read the rows
Landing pages show sessions and bounce rate. Example rows are labeled example and are not this site's traffic.
Count missing answers
The not-found count is a number. The question text is not stored and is not a parameter.
Draft from the evidence
A suggestion is written only when the bounce rate clears the threshold or the not-found count is above zero.
Keep the pull request off
The opener calls api.github.com only when the flag, the token, and the repo are set. It creates a draft and does not merge.
From the code
A high bounce rate becomes one suggestion. The evidence repeats the sessions and the rate.
Recommended next
Why these picksReading path transitions…