traffic-forecast
Traffic Forecast
Project future clicks or impressions for one property, place the projection next to last year's numbers and the seasonal shape, and say what has to change to beat the baseline. Every projected figure is an estimate and is labelled as one. The user's request may contain a property, the metric (clicks or impressions), a horizon ("next quarter", "12 months"), a growth target, a conversion rate and average order value for a revenue view, or the window to compare year over year.
Steps
-
Resolve the property and the inputs. 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. Then translate the horizon intogranularityandforecastPeriods:- "next quarter" is
weeklywith 13 periods, "six months"weeklywith 26 (the default), "next year"monthlywith 12. - Weekly needs about 105 days of history (13 complete weeks) and monthly about 240 days (6 complete months), because the first and last period of the window are dropped as partial.
- "next quarter" is
-
Check whether the history is representative. Call
detect_change_pointswithmetricset to the metric being forecast anddays: 180; raise it to480to cover the forecast's full default history (the window must stay between 14 and 480 days). Read:changePoints: each break carriesdate,direction,changePercent, andbeforeMean/afterMean, which are window means overwindowDaysdays either side of the break, not whole-period means (segmentMeanBefore/segmentMeanAftercover the full segments).- A break dated inside the last 90 days means the series moved to a new level recently and the trendline will blend the old level with the new one. Say so, and offer to shorten
historyDaysto the days since the break, never below 90 and never below what the granularity needs. - When
beforeMeanis 0,changePercentis 0 by convention and the shift is traffic from zero, not "no change". - With
count0,trendSummarystill carries the overall movement (firstMean14d,lastMean14d,ratio,slopePerDay,direction,halfwayDate); reademptyBecauseandnextStepbefore calling the traffic stable.