Skip to content

Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.

fix(brands): say ChatGPT Shopping comes with Growth on the Shopping mode card (#1231)

Cihanabfd23b9b5dc
diff --git a/server/src/workers/tracking-worker.test.js b/server/src/workers/tracking-worker.test.js
index 201c75f08..f340e90ba 100644
--- a/server/src/workers/tracking-worker.test.js
+++ b/server/src/workers/tracking-worker.test.js
@@ -14,7 +14,7 @@ import {
tailRemainder,
UNAVAILABLE_PLATFORMS,
} from './tracking-worker.js';
-import { PLANS } from '../config/plans.js';
+import { getPlan, PLANS } from '../config/plans.js';
/**
* Ghost detection for the Cloro drain loop (#687).
@@ -257,19 +257,6 @@ describe('runnablePlatforms', () => {
});
});
-/**
- * The short tail for watched runs.
- *
- * A brand's first analysis is started from the UI and its progress bar stays on
- * screen for as long as the drain loop polls. One measured run delivered all
- * 292 of its results in four and a half minutes, then held the bar at 292/294
- * for another twenty-five waiting on two google-aio tasks that were never going
- * to call back. Across ten days, runs spent an average of 19 minutes waiting on
- * ghosts against 14 minutes actually receiving results.
- *
- * Nothing is lost by leaving early: /cloro/callback inserts a late delivery
- * whether or not the loop is still watching.
- */
describe('shoppingTracked', () => {
const on = { shopping_mode_enabled: true };
@@ -285,8 +272,32 @@ describe('shoppingTracked', () => {
expect(shoppingTracked({ shopping_mode_enabled: false }, PLANS.growth)).toBe(false);
expect(shoppingTracked({ shopping_mode_enabled: false }, null)).toBe(false);
});
+
+ it('fails closed on cloud for a plan id it does not know', () => {
+ vi.stubEnv('IS_CLOUD', 'true');
+ try {
+ // getPlan falls back to Starter, which has no Shopping page.
+ expect(shoppingTracked(on, getPlan('bogus'))).toBe(false);
+ expect(shoppingTracked(on, getPlan('growth'))).toBe(true);
+ } finally {
+ vi.unstubAllEnvs();
+ }
+ });
});
+/**
+ * The short tail for watched runs.
+ *
+ * A brand's first analysis is started from the UI and its progress bar stays on
+ * screen for as long as the drain loop polls. One measured run delivered all
+ * 292 of its results in four and a half minutes, then held the bar at 292/294
+ * for another twenty-five waiting on two google-aio tasks that were never going
+ * to call back. Across ten days, runs spent an average of 19 minutes waiting on
+ * ghosts against 14 minutes actually receiving results.
+ *
+ * Nothing is lost by leaving early: /cloro/callback inserts a late delivery
+ * whether or not the loop is still watching.
+ */
describe('tailRemainder', () => {
it('scales with the run for a large brand', () => {
expect(tailRemainder(294)).toBe(15);
diff --git a/web/messages/en.json b/web/messages/en.json
index 72b0b7afd..0019edc91 100644
--- a/web/messages/en.json
+++ b/web/messages/en.json
@@ -4742,6 +4742,7 @@
"label": "This brand is in e-commerce / shopping",
"help": "Adds <code>chatgpt-shopping</code> to every existing prompt's platform list and enables the Shopping platform on this brand.",
"managersOnly": "Only admins and managers can change this setting.",
+ "planNote": "ChatGPT Shopping comes with the {plan} plan. On this plan the prompts keep it, but it isn’t tracked.",
"on": "Shopping mode on",
"onWithPrompts": "Shopping mode on: {count, plural, one {# prompt} other {# prompts}} updated",
"off": "Shopping mode off",
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/brands/[id]/settings/page.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/brands/[id]/settings/page.test.tsx
index ec0e7ec26..5cb62e6f3 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/brands/[id]/settings/page.test.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/brands/[id]/settings/page.test.tsx
@@ -57,6 +57,15 @@ vi.mock('@/hooks/use-user-role', () => ({
useUserRole: () => role,
}));
+// Whether the plan has the Shopping page (ChatGPT Shopping is tracked).
+const plan = vi.hoisted(() => ({ shopping: true }));
+vi.mock('@/hooks/use-feature-gate', () => ({
+ useFeatureGate: () => ({
+ canUse: (feature: string) => feature !== 'shopping_analytics' || plan.shopping,
+ requiredPlanFor: () => 'Growth',
+ }),
+}));
+
const setBrandShoppingMode = vi.hoisted(() => vi.fn());
vi.mock('@/lib/actions/brand', () => ({
deleteBrand: vi.fn(),
@@ -177,6 +186,19 @@ describe('brand settings Shopping mode', () => {
await act(async () => root.unmount());
});
+ it('says ChatGPT Shopping comes with Growth on a plan that does not track it', async () => {
+ Object.assign(role, { canAdmin: true, canManage: true });
+ plan.shopping = false;
+ const { container, root } = await render();
+ expect(container.textContent).toContain('settings.shopping.planNote');
+ await act(async () => root.unmount());
+
+ plan.shopping = true;
+ const again = await render();
+ expect(again.container.textContent).not.toContain('settings.shopping.planNote');
+ await act(async () => again.root.unmount());
+ });
+
it('shows anyone else the setting without letting them change it', async () => {
Object.assign(role, { canAdmin: false, canManage: false });
const { container, root, checkbox } = await render();
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/brands/[id]/settings/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/brands/[id]/settings/page.tsx
index 55e140cbf..83406ade9 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/brands/[id]/settings/page.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/brands/[id]/settings/page.tsx
@@ -47,6 +47,7 @@ import {
} from 'lucide-react';
import { Checkbox } from '@/components/ui/checkbox';
import { useUserRole } from '@/hooks/use-user-role';
+import { useFeatureGate } from '@/hooks/use-feature-gate';
import {
Dialog,
DialogContent,
@@ -325,6 +326,10 @@ function ShoppingModeCard({
const t = useTranslations('brands');
// Admins and managers, as the brands, prompts and brand_platforms writes allow.
const { canManage } = useUserRole();
+ // ChatGPT Shopping is tracked only on plans with the Shopping page (#1212):
+ // on others the prompts still carry it, but nothing runs it.
+ const { canUse, requiredPlanFor } = useFeatureGate();
+ const tracked = canUse('shopping_analytics');
const [enabled, setEnabled] = useState(brand.shoppingModeEnabled);
const [saving, setSaving] = useState(false);
@@ -377,6 +382,11 @@ function ShoppingModeCard({
),
})}
</p>
+ {!tracked && (
+ <p className="text-xs text-amber-700 dark:text-amber-400">
+ {t('settings.shopping.planNote', { plan: requiredPlanFor('shopping_analytics') })}
+ </p>
+ )}
{!canManage && (
<p className="text-xs text-muted-foreground">{t('settings.shopping.managersOnly')}</p>
)}