mirror of
https://github.com/AJaySi/ALwrity.git
synced 2026-04-25 00:45:54 +03:00
[PR #436] Add GSC opportunity scorer and wire into analytics/onboarding flows #739
Labels
No labels
AI Content Agents
AI Content Strategy
AI Content planning
AI Marketing Tools
AI SEO
AI personalization
AI writer
ALwrity Copi-lot
Alwrity web search
Anthropic
DeepSeek
Gemini AI
Integration
LLM
OnBoarding
OnBoarding
RAG knowledgebase Memory
bug
documentation
enhancement
good first issue
help wanted
invalid
openai
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ALwrity#739
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/AJaySi/ALwrity/pull/436
Author: @AJaySi
Created: 3/12/2026
Status: 🔄 Open
Base:
main← Head:codex/create-opportunity-scorer-module-rrw4cv📝 Commits (1)
20145f7Add analytics opportunity scorer and integrate into GSC flows📊 Changes
4 files changed (+348 additions, -1 deletions)
View changed files
📝
backend/api/content_planning/services/content_strategy/onboarding/data_integration.py(+74 -0)📝
backend/services/analytics/handlers/gsc_handler.py(+87 -1)➕
backend/services/analytics/opportunity_scorer.py(+128 -0)📝
backend/services/gsc_service.py(+59 -0)📄 Description
Motivation
previous_periodpayload from the GSC service so rising/declining trends can be detected.Description
backend/services/analytics/opportunity_scorer.pywith pure functions:high_impression_low_ctr_queries,rising_queries,declining_pages,score_and_rank_opportunities, andcategorize_opportunities, returning the stable opportunity schema (id,query,page_url,reason,score,current_metrics,previous_metrics).GSCAnalyticsHandlerby normalizing current/previous query & page rows, callingcategorize_opportunities(...), and returningopportunitiesalongside existing metrics in handler responses.GSCService.get_search_analyticsto compute a matching previous-date window and optionally fetch previous-periodqueryandpagerows (addedprevious_periodin the analytics payload) to enable window-over-window deltas.backend/api/content_planning/.../data_integration.py) so_get_gsc_analyticsincludesopportunitiesin its output and the onboarding flow reuses the same stable schema.Testing
python -m py_compile backend/services/analytics/opportunity_scorer.py backend/services/analytics/handlers/gsc_handler.py backend/services/gsc_service.py backend/api/content_planning/services/content_strategy/onboarding/data_integration.py; compilation succeeded.from services.analytics.opportunity_scorer import categorize_opportunities) with representative query/page rows to validate categorization and ranking; the function produced a ranked list matching the stable schema.Codex Task
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.