Hi Growthbook team! We are currently evaluating Gr...
# ask-questions
a
Hi Growthbook team! We are currently evaluating Growthbook with Managed Warehouse and HTML Script Tag SDK, however we've encountered multiple issues with tracking, in particular in Safari. We’ve created a proxy (as described here: https://docs.growthbook.io/self-host/proxy#using-with-the-sdks) on our own domain that passes requests to cdn.growthbook.io, however we are still experiencing issues with the other domain, gb-ingest.com. Here is a screenshot of the console error that happens on form submit on one of the experiment pages, https://www.123cards.com/membership/?source=10&cmid=free-trial Should we add a CNAME for us1.gb-ingest.com pointing to gb-events.123cards.com? Are any additional changes required on your side or our side for this to work?
a
Hi Andre. GrowthBook’s Managed Warehouse expects the HTML Script Tag SDK to include `data-tracking="growthbook"`; with that plugin enabled, GrowthBook automatically sends feature usage and experiment view events, and you can also send custom events through
window.gbEvents
a
Hi @astonishing-engineer-93454, Thank you for your reply. We do have
data-tracking="growthbook"
included (see attached screenshot), and the experiments do run on the site. The problem is that sometimes events are not being sent, as the scripts are blocked due to access control checks. @nutritious-notebook-68264 recommended that we create a proxy, however that didn't help, as there still is another domain that is not proxied and that is being blocked: gb-ingest.com Do we need to add a proxy for that domain as well? It is not described in the docs though (https://docs.growthbook.io/self-host/proxy#using-with-the-sdks)
a
Andre do you have a localhost env to compare by
a
No, we've only added the script to our site
f
That seems like a CORS problem
can you edit your access control headers?
a
Hi Graham! We can edit the access control headers on Cloudflare if we proxy a subdomain to
<http://us1.gb-ingest.com|us1.gb-ingest.com>
We've proxied
<http://cdn.growthbook.io|cdn.growthbook.io>
through Cloudfront following your CDN docs, and that's working. But the SDK is still sending events directly to
<http://us1.gb-ingest.com|us1.gb-ingest.com>
, which is what's causing the CORS issue. Two questions: 1. What SDK parameter should we use to override the event ingestion endpoint so I can point it to our own proxied domain (e.g.
<http://gb-events.123cards.com|gb-events.123cards.com>
)? 2. Is there any documentation on proxying the ingestion endpoint, similar to the CDN proxy docs?
a
The JS SDK’s
apiHost
is for feature/config fetching, not event ingestion (https://docs.growthbook.io/app/managed-warehouse)
Use
ingestorHost
on the GrowthBook tracking plugin. </> TS
Copy code
import { GrowthBook } from "@growthbook/growthbook";
import {
  autoAttributesPlugin,
  growthbookTrackingPlugin,
} from "@growthbook/growthbook/plugins";

const gb = new GrowthBook({
  apiHost: "<https://cdn-proxy.123cards.com>", // feature payload/CDN proxy
  clientKey: "sdk-xxxx",
  plugins: [
    autoAttributesPlugin(),
    growthbookTrackingPlugin({
      ingestorHost: "<https://gb-events.123cards.com>",
    }),
  ],
});