diff --git a/apps/console/src/pages/organizations/cookie-banners/configuration/cookies/_components/CategorySection.tsx b/apps/console/src/pages/organizations/cookie-banners/configuration/cookies/_components/CategorySection.tsx
index 90893b9ec..11f5b2f09 100644
--- a/apps/console/src/pages/organizations/cookie-banners/configuration/cookies/_components/CategorySection.tsx
+++ b/apps/console/src/pages/organizations/cookie-banners/configuration/cookies/_components/CategorySection.tsx
@@ -60,6 +60,7 @@ export const categorySectionFragment = graphql`
description
kind
gcmConsentTypes
+ posthogConsent
cookies(first: 100, orderBy: { field: CREATED_AT, direction: ASC })
@connection(key: "CategorySection_cookies", filters: [])
@required(action: THROW) {
@@ -99,6 +100,7 @@ const updateCategoryMutation = graphql`
description
rank
gcmConsentTypes
+ posthogConsent
updatedAt
}
cookieBanner {
@@ -239,7 +241,10 @@ export function CategorySection({ categoryKey, onDelete }: CategorySectionProps)
const cookies = category.cookies.edges.map(e => e.node);
const isMutating = isUpdating || isCreating || isUpdatingCookie;
- const handleSaveCategory = (name: string, slug: string, description: string, gcmConsentTypes: string[]) => {
+ const handleSaveCategory = (
+ name: string, slug: string, description: string,
+ gcmConsentTypes: string[], posthogConsent: boolean,
+ ) => {
updateCategory({
variables: {
input: {
@@ -248,6 +253,7 @@ export function CategorySection({ categoryKey, onDelete }: CategorySectionProps)
slug,
description,
gcmConsentTypes,
+ posthogConsent,
},
},
onCompleted(_response, errors) {
@@ -485,6 +491,7 @@ export function CategorySection({ categoryKey, onDelete }: CategorySectionProps)
slug={category.slug}
description={category.description}
gcmConsentTypes={[...category.gcmConsentTypes]}
+ posthogConsent={category.posthogConsent}
isUpdating={isUpdating}
onSave={handleSaveCategory}
onCancel={() => setIsEditingCategory(false)}
@@ -541,6 +548,16 @@ export function CategorySection({ categoryKey, onDelete }: CategorySectionProps)
))}
)}
+ {category.posthogConsent && (
+
(gcmConsentTypes);
+ const [editPosthogConsent, setEditPosthogConsent] = useState(posthogConsent);
const toggleGcmType = (type: string) => {
setEditGcmTypes(prev =>
@@ -102,11 +105,28 @@ export function EditCategoryForm({
))}
+
+
+
+ {__("Control PostHog tracking consent based on this category.")}
+
+
+