Skip to content

Add Google Business Profile support - #318

Closed
thethomasjfellows wants to merge 12 commits into
trypostit:mainfrom
thethomasjfellows:contrib/google-business-profile
Closed

Add Google Business Profile support#318
thethomasjfellows wants to merge 12 commits into
trypostit:mainfrom
thethomasjfellows:contrib/google-business-profile

Conversation

@thethomasjfellows

Copy link
Copy Markdown

Summary

  • add Google Business Profile OAuth, managed location selection, per-location post targets, authoring controls, publishing/reconciliation, analytics, and AI/API/MCP integration
  • include Google-specific image derivative handling, retry/lifecycle safeguards, translation parity, and focused test coverage
  • replayed cleanly from current upstream/main; no private deployment, release, infrastructure, secret, or client material is included

Validation

  • vendor/bin/pint --dirty --format agent
  • PHP syntax check for all changed PHP files
  • npm run build (with local test APP_URL)
  • git diff --check
  • focused GBP Pest suite attempted, but this fresh upstream worktree fails before setup because its shared local dependency/test bootstrap leaves the Laravel HTTP facade unbound (45 setup failures, 0 assertions).

@paulocastellano

Copy link
Copy Markdown
Contributor

Thomas — thank you for this. It's a serious piece of work, and the multi-location model plus the review-state reconciliation are the parts I hadn't thought through properly in my own branch.

I'm going to close this one and land Google Business Profile through #270 instead. That branch is smaller, already rebased on main, and it's the one I can maintain going forward — but it's missing things yours got right, and I'd rather take those from you than reinvent them.

Porting from here:

  • Reading the Local Post state and reconciling it. My branch marks a target published on the HTTP 200, so a post Google rejects in review still shows as published, with a dashboard URL instead of the real searchUrl. Your PROCESSINGLIVE/REJECTED job is the right fix, and handling RECURRING and SCHEDULED alongside them is a detail I would have missed.
  • The daily metrics I was missingBUSINESS_IMPRESSIONS_DESKTOP_SEARCH, _MOBILE_SEARCH and BUSINESS_CONVERSATIONS. Mine only read the Maps impressions, which is the smaller half of the number for most businesses. I'll render BUSINESS_BOOKINGS, BUSINESS_FOOD_ORDERS and BUSINESS_FOOD_MENU_CLICKS only when they're non-zero, so a dentist doesn't get three permanent zeros.
  • Search keyword impressions, including the threshold handling. Rendering <15 instead of 15 for a suppressed term is easy to get silently wrong, and you got it right.
  • The JPEG derivative for the post image. Mine hands Google the raw media URL.
  • pageSize: 20 on accounts.list. I was sending 100; the documented maximum is 20.

Leaving out, in case it saves you time later:

  • GET_OFFER is deprecated in the v4 ActionType enum.
  • ALERT only accepts COVID_19, and Google has disabled creating new ones — your own isAuthorable() already says as much, so this only ever renders history.
  • Event recurrence is on the list, just not for this round.
  • localPosts.reportInsights was sunset on 2022-11-21 and discontinued on 2023-02-20, along with LOCAL_POST_VIEWS_SEARCH and LOCAL_POST_ACTIONS_CALL_TO_ACTION — the only two metrics it took. There's no replacement, which is why fetchPostMetrics() always ends up in your capability-unavailable branch and never returns a number. The method's reference page is still live with no deprecation banner; it's on the deprecation schedule that it shows up as dead. Business Profile has no per-post insights API any more, only location-level metrics on Performance v1.

One thing I picked up reading your diff that neither of us used: metadata.canOperateLocalPost comes back in the readMask we both already request, and tells you whether a location can receive Local Posts at all. I'm going to use it to filter the picker.

Once the port is in, I'd really value you testing and reviewing #270. You clearly know this API better than the diff lets on, and I'd rather have you on the review than have written it alone.

@thethomasjfellows

Copy link
Copy Markdown
Author

Thanks, Paulo, that makes sense. I appreciate the careful read and the credit.

I’m glad the multi-location model, review-state reconciliation, metrics/search-term handling, and JPEG derivative were useful. Keeping the final implementation on the smaller rebased branch sounds like the right maintenance choice.

Thanks again for carrying it forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants