Repository navigation
feat(integrations): map each brand to a GA4 property - #703
Merged
Merged
Conversation
7 of 12 tasks
Phase 1 connected a Google Analytics account to the organization but left it inert: a connected account exposes many GA4 properties and nothing said which one belongs to which brand. Adds brands.ga_property_id and a mapping block under the Analytics card, mirroring the Search Console mapping. Auto-matching resolves each property's web data streams and compares the stream's site URL against the brand's domains, rather than guessing from the display name. A GA4 property is a numeric id plus free text, so name matching would be unreliable; the stream URL is the real site. Stream lookups are one call per property, so they run with bounded concurrency and a configurable ceiling — properties past it stay listed and manually selectable, they just skip the auto-match. Manual selection always wins. Both providers now render one shared PropertyMapping component instead of a copy per provider; the domain matching moved to property-match.ts, with gsc.ts adapting Search Console's "the property is the URL" shape to it.
gkhngyk
force-pushed
the
feature/694-ga-property-mapping
branch
from
August 12, 2026 09:04
4943f25 to
afd6460
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 1 (#658) connected a Google Analytics account to the organization and stopped there — a connected account exposes many GA4 properties, and nothing said which one belongs to which brand, so the connection did nothing.
This adds
brands.ga_property_idand a mapping block under the Google Analytics card, mirroring the Search Console mapping from #642: one row per brand, a property picker, and a "N of M brands mapped" counter. Org-scoped and role-gated exactly like the GSC mapping.The matching decision the issue asked us to make deliberately: data streams, not display names. A GA4 property is a numeric id plus whatever the customer typed as a name, so a name match would be a guess. Each property's web data streams carry the real site URL (
webStreamData.defaultUri), which compares against the brand's domains the same way a Search Console property URL does. Listing is one call; streams are one call per property, so they run with bounded concurrency (8) and a configurable ceiling. Properties past the ceiling are still listed and still selectable by hand — they just sit out the auto-match. Manual selection always overrides.Two things worth flagging for review:
LIST_ACCOUNT_SUMMARIESandLIST_DATA_STREAMSare used throughtools.execute, the same path as Search Console, which means the same pinned-version requirement — henceCOMPOSIO_GA_TOOLKIT_VERSION(default20260721_00, matching the GSC pin).GscPropertyMapping, both providers render onePropertyMappingcomponent and supply their own loaders. The domain matching moved intoproperty-match.ts;gsc.tsbecame a thin adapter for Search Console's "the property is the URL" shape, so its existing tests pass unchanged.Migration
00050has already been applied to the hosted database.Related issue
Closes #694
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
COMPOSIO_GA_AUTH_CONFIG_IDstill shows the "not configured" card.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)