wide-cartoon-5349
09/20/2024, 2:22 PMorange-terabyte-33302
09/20/2024, 2:22 PMorange-terabyte-33302
09/20/2024, 2:22 PMjavascript GROWTHBOOK_TRACKING_CALLBACK="(experiment, results) => { if (/* condition to check if there are active experiments */) { console.log('browser tracking callback', {experiment, results}); } }"
In the above code, replace /* condition to check if there are active experiments */
with your actual condition. This will ensure that the tracking callback (and thus the GA4 event) is only triggered when there are active experiments. Please note that the exact condition will depend on how you are managing and checking the status of your experiments. You might need to refer to your experiment management system or GrowthBook's API to determine whether there are any active experiments. For more information on tracking callbacks and how to customize them, you can refer to the [GrowthBook documentation](https://docs.growthbook.io/lib/edge/other#tracking-experiment-views).