Add PostHog consent integration and extract integration plugin system
Add PostHog opt-in/opt-out consent support mirroring the existing Google Consent Mode integration: database column, GraphQL field, console UI toggle, and client-side posthog-js calls. Extract both GCM and PostHog logic from CookieBannerClient into a ConsentIntegration plugin interface so future integrations can be added without modifying the client core. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -74,6 +74,7 @@ type (
|
||||
Slug *string
|
||||
Description *string
|
||||
GCMConsentTypes *[]string
|
||||
PostHogConsent *bool
|
||||
}
|
||||
|
||||
CreateCookieRequest struct {
|
||||
@@ -360,6 +361,7 @@ func buildSnapshot(
|
||||
Kind: c.Kind,
|
||||
Cookies: cookies,
|
||||
GCMConsentTypes: gcmConsentTypes,
|
||||
PostHogConsent: c.PostHogConsent,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1347,6 +1349,9 @@ func (s *Service) UpdateCookieCategory(
|
||||
if req.GCMConsentTypes != nil {
|
||||
category.GCMConsentTypes = *req.GCMConsentTypes
|
||||
}
|
||||
if req.PostHogConsent != nil {
|
||||
category.PostHogConsent = *req.PostHogConsent
|
||||
}
|
||||
|
||||
category.UpdatedAt = time.Now()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user