https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
o

orange-chef-81249

12/13/2023, 6:47 PM
Hello! We recently set-up an A/B test in Growthbook and we can see that the queries and metrics seem to be updating correctly, however when we try to review the results of the experiment we are still getting the following message '*No data yet. Make sure your experiment is tracking properly*'. Is anybody familiar with this + how to fix? screenshot 1: query example screenshot 2: metrics example screenshot 3: results example with the '*No data yet*..." message that we are trying to solve for Cc: @astonishing-market-55169
👀 1
f

fresh-football-47124

12/13/2023, 7:11 PM
Hi Amanda - can you check the assignment queries on the data source page?
particularly the 'anonymous visitors' query, which is what you're using in the experiment report
a

astonishing-market-55169

12/13/2023, 7:31 PM
Hi @fresh-football-47124, this query is what you want to check?
f

fresh-football-47124

12/13/2023, 7:31 PM
yes
if you click test query, do you get any results?
a

astonishing-market-55169

12/13/2023, 7:32 PM
nop
f

fresh-football-47124

12/13/2023, 7:32 PM
how long has this test been running?
a

astonishing-market-55169

12/13/2023, 7:33 PM
2 days, but today I change the SDK for the simple version for Shopify stores. Could that have affected the events?
f

fresh-football-47124

12/13/2023, 7:34 PM
well, you may not see events in BigQuery for up to a day due to the data sync delay (unless you pay for the intraday stats)
but since you have no events, I'd want to make sure that the tracking callback is setup correctly
can you confirm that users are being bucketed correctly?
a

astonishing-market-55169

12/13/2023, 7:38 PM
I’m not sure how to check it, but I followed the guide and test it with the GrowthBook extension and seems to be ok. Should I test something else?
f

fresh-football-47124

12/13/2023, 7:38 PM
looks okay - what do you have for your trackingCallback?
a

astonishing-market-55169

12/13/2023, 7:41 PM
Screenshot 2023-12-13 at 16.41.40.png
f

fresh-football-47124

12/13/2023, 7:52 PM
looks good - but something strange is happening
I do see me being assigned to an experiment, but I don't see the console log firing
but I see that I've been assigned a gbuuid
are you sure this version is what is live?
a

astonishing-market-55169

12/13/2023, 7:53 PM
yes, I added the console log part on my dev theme, only to test
f

fresh-football-47124

12/13/2023, 8:09 PM
okay
is it possible that gtag is not ready when you're firing that event?
can you see the console log on your dev?
a

astonishing-market-55169

12/13/2023, 8:22 PM
the weird thing is that, I’m not able to see the console log on the trackingCallback function 😐
f

fresh-football-47124

12/13/2023, 8:49 PM
from the product pages?
ya, I'm not sure you're loading google analytics correctly
ah
so gtag isn't defined
you may have to use the dataLayer approach
Copy code
trackingCallback: function (experiment, result) {
  dataLayer.push({
    'event': 'experiment_viewed',
    'event_category': 'experiment',
    'experiment_id': experiment.key,
    'variation_id': result.variationId
  })
})
(gtag is not defined on your site)
a

astonishing-market-55169

12/14/2023, 10:47 AM
Hi Graham, thank you for your recommendation. I also tested with dalayer approach, but I did not see the console log inside the trackingCallback function… Also if I remove the event part and only leave the console log one, I do not see it. Is there another way I can test the trackingCallback function?
f

famous-bird-26809

12/14/2023, 12:43 PM
exctly the same problem in my case, we cant even see console log, its not about if gtag is defined or not
😐 1
o

orange-chef-81249

12/14/2023, 6:30 PM
@fresh-football-47124 any thoughts here?
🦗 1
b

brief-honey-45610

12/15/2023, 4:25 PM
We are still looking into this
👍 1
@orange-chef-81249 @astonishing-market-55169 and @famous-bird-26809 Hi again, we are still looking into this. Could you please tell me: 1. Which unique attribute are you using per user? Something like user_id or anonymous_id? 2. Have you been running into this issue while using preview links? 3. Are you certain that the user for whom the trackingCallback is not firing should be included in the experiment? 4. Are you getting your very first experiment setup with GrowthBook, or have you already been running experiments successfully and this is happening now all of a sudden? 5. Are visual experiments enabled for the SDK key (client key) you're using for this experiment? This is something you would have had to toggle on when creating the key. 6. Which specific SDK are you using? Is it an official GrowthBook SDK or one created by a 3rd party? 7. Which guide or tutorial are you following to get the experiment set up? Your response to each of these questions will be very helpful in narrowing down what is causing the issue. It’s like not with the trackingCallback itself, since that code hasn’t changed in a long time, but it could be something related to the SDK payload and that’s the angle we’re currently investigating.
a

astonishing-market-55169

12/15/2023, 4:53 PM
Hi @brief-honey-45610, I leave you my answers below: 1. This is the code that I’m currently running
Copy code
let gb = new growthbook.GrowthBook({
          apiHost: "<https://cdn.growthbook.io>",
          clientKey: "SECRET",
          attributes: {
            id: gbuuid
          },
          enableDevMode: true,
          subscribeToChanges: true,
          trackingCallback: function(experiment, result) {
            dataLayer.push({
              'event': 'experiment_viewed',
              'event_category': 'experiment',
              'experiment_id': experiment.key,
              'variation_id': result.variationId,
              'gb_user_id': gbuuid
            })

            console.log("Viewed Experiment", {
              experimentId: experiment.key,
              variationId: result.key
            });
          }
        });
2. For me this is happening with theme preview links and also in the live production version of the theme 3. Yes, because I’m able to see the CSS variations of my experiment (original and V1) and in both cases I’m not able to see the console logs 4. Is my first experiment with Growthbook 5. Yes it’s enabled 6. I’m using this one 7. I mainly followed multiple recommendations based on Growthbook documentation and youtube videos
f

famous-bird-26809

12/15/2023, 8:29 PM
for me everything like above. My code:
Copy code
import { GrowthBook } from '@growthbook/growthbook'
import { setCookieUUID } from '@/composables/useSetCookieUUID'
import { Growthbook } from '@/constants/Growthbook'

export default defineNuxtPlugin(async (nuxtApp) => {
  const config = useRuntimeConfig()
  let clientId = ''

  if (document?.cookie?.indexOf('_ga=') > -1) {
    const gaCookie = document.cookie.match(/_ga=(.+?);/)

    if (gaCookie) {
      clientId = gaCookie[1].split('.').slice(-2).join('.')
    }
  }
  const gb = new GrowthBook({
    apiHost: config.public.growthbook.apiHost,
    clientKey: config.public.growthbook.clientKey,
    attributes: {
      id: setCookieUUID(Growthbook.USER_UUID_COOKIE_NAME),
      clientId: clientId
    },
    enableDevMode: process.env.NODE_ENV === 'development',
    //here should be real gtm action
    trackingCallback: (experiment, result) => {
      console.log('Experiment Viewed', {
        experimentId: experiment.key,
        variationId: result.key
      })
    }
  })

  await gb.loadFeatures()

  if (process.client && !window._growthbook) {
    window._growthbook = gb
  }

  nuxtApp.provide(
    'growthbook',
    process.client && window._growthbook ? window._growthbook : null
  )
})
o

orange-chef-81249

12/15/2023, 8:47 PM
@fresh-football-47124
f

fresh-football-47124

12/15/2023, 8:49 PM
So the console.log is live on production now?
f

famous-bird-26809

12/15/2023, 9:09 PM
console.log doesnt work for example on that kind of url with feature flag:
<http://localhost:3000/mieszkania/?boolean-test-feature=1>
with checking in code that flag receives true:
Copy code
gb.isOn(Growthbook.IS_MAP_ENABLED_FEATURE_FLAG) // returns true
i still cant see any log from trackingCallback
f

fresh-football-47124

12/15/2023, 9:12 PM
@famous-bird-26809 are you on the same team as Amanda?
f

famous-bird-26809

12/15/2023, 9:14 PM
no, I just joined the Amandas thread because of the same problem
f

fresh-football-47124

12/15/2023, 9:15 PM
ya, but your problem is different
can you open a new thread just for my sanity? 🙂
f

famous-bird-26809

12/15/2023, 9:18 PM
ok
f

fresh-football-47124

12/15/2023, 9:22 PM
For Amanda, is the console.log live on prod?
o

orange-chef-81249

12/15/2023, 9:23 PM
@astonishing-market-55169
f

fresh-football-47124

12/15/2023, 9:26 PM
I dont see the experiment on production atm (at least not like last time)
a

astonishing-market-55169

12/18/2023, 10:07 AM
Yes the console log and also the datalayer is on production
I changed from gtag to datalayer and also uncommented the console logs
o

orange-chef-81249

12/18/2023, 9:56 PM
@fresh-football-47124 tagging you here!
f

fresh-football-47124

12/18/2023, 10:07 PM
okay, any change?
a

astonishing-market-55169

12/19/2023, 10:12 AM
nop, nothing yet 😞
f

fresh-football-47124

12/19/2023, 8:13 PM
is this live?
I can check the site if you send me a link
a

astonishing-market-55169

12/20/2023, 10:06 AM
yes, it’s live. This is the site url. Thanks
f

fresh-football-47124

12/20/2023, 6:21 PM
the code looks good
o

orange-chef-81249

12/22/2023, 12:30 AM
@fresh-football-47124 @astonishing-market-55169 anything else we can try here?
f

fresh-football-47124

12/23/2023, 4:04 AM
I didn't see any active experiments - but it looks like it is working
4 Views