Having Tracking issues on self-host: made it throu...
# ask-questions
p
Having Tracking issues on self-host: made it through the CORS problems, the nginx header problems, and finally got growthbook comunicating. Due to the Gridpane cache we have to use a js sdk, but the only way i could get a GB API call to server is with
Copy code
(function(s) {
		s=document.createElement('script'); s.async=true;
		s.dataset.clientKey="dev_###";
		s.src="<https://cdn.jsdelivr.net/npm/@growthbook/growthbook/dist/bundles/auto.min.js>";
		s.dataset.apiHost="<https://gbapi.columbian.com>"
		s.onload = () => {
			console.log('Growthbook Loaded');
		}
		document.head.appendChild(s);
	})()
however, I cannot get any tracking results. The page updates with the feature flag changes for each version... but zero tracking. I have tried adding both
Copy code
window.GROWTHBOOK_CONFIG = {
	  // Impression tracking callback (e.g. Segment, Mixpanel, GA)
	  track: function(experimentId, variationId) {
	    push_GA4_event("Experiment Viewed", {
	      experimentId,
	      variationId
	    })
	  }
	}
and
Copy code
const FEATURES_ENDPOINT = "<https://gbapi.columbian.com/api/features/dev_###>";
fetch(FEATURES_ENDPOINT)
  .then((res) => res.json())
  .then((json) => {
    growthbook.setFeatures(json.features);
  })
  .catch(() => {
    console.log("Failed to fetch feature definitions from GrowthBook");
  });
with no success and no tracking.
f
track isn't the right name for a custom tracking callback: https://docs.growthbook.io/lib/script-tag#others
p
Thank you so much, I knew it was some small little piece of instruction I missed somewhere. Much Appreciated. It looks like it is pushing the "Viewed Experiment" event, just waiting on BigQuery to update to verify.
r
Hi Desmond, that's great! Let us know how the BigQuery data pull goes and if you need any help with that.