29. GA4 Error Response Shape (SF-124) | SEO Forge - Rank Higher with AI-Powered SEO
Download Log in

29. GA4 Error Response Shape (SF-124)

Developer Guide

The /wp-admin/admin-ajax.php?action=seoforge_ga4_properties handler now classifies errors so the client can render a localised UI without ever showing raw Google API text.

Successful response (unchanged):
json
{ "success": true, "data": { "properties": [ ... ], "current": "properties/123" } }
Error response:
json
{
    "success": false,
    "data": {
        "code":        "auth_revoked",                  // or "server_error"
        "status":      401,
        "message_raw": "Google returned: invalid_grant",
        "auth_url":    "https://api.avakode.com/integrations/google/auth?license_key=…"
    }
}
code values:
  • auth_revoked — 401/403 or message contains reconnect/no google; UI shows “Access lost” + Reconnect button.
  • server_error — everything else; UI shows “Temporary connection issue” + Retry button.
message_raw is retained for developer debugging only — the UI never renders it (it’s logged to console.warn).
Forge AI Assistant Online

Hi! I'm the SEO Forge AI assistant. Ask me anything about the plugin — setup, features, troubleshooting, or development.

Just now
Powered by Forge AI · Browse docs