Hello! We recently set-up an A/B test in Growthboo...
# ask-questions
o
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
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
Hi @fresh-football-47124, this query is what you want to check?
f
yes
if you click test query, do you get any results?
a
nop
f
how long has this test been running?
a
2 days, but today I change the SDK for the simple version for Shopify stores. Could that have affected the events?
f
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
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
looks okay - what do you have for your trackingCallback?
a
Screenshot 2023-12-13 at 16.41.40.png
f
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
yes, I added the console log part on my dev theme, only to test
f
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
the weird thing is that, I’m not able to see the console log on the trackingCallback function 😐
f
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
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
exctly the same problem in my case, we cant even see console log, its not about if gtag is defined or not
😐 1
o
@fresh-football-47124 any thoughts here?
🦗 1
b
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
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
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
@fresh-football-47124
f
So the console.log is live on production now?
f
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
@famous-bird-26809 are you on the same team as Amanda?
f
no, I just joined the Amandas thread because of the same problem
f
ya, but your problem is different
can you open a new thread just for my sanity? 🙂
f
ok
f
For Amanda, is the console.log live on prod?
o
@astonishing-market-55169
f
I dont see the experiment on production atm (at least not like last time)
a
Yes the console log and also the datalayer is on production
I changed from gtag to datalayer and also uncommented the console logs
o
@fresh-football-47124 tagging you here!
f
okay, any change?
a
nop, nothing yet 😞
f
is this live?
I can check the site if you send me a link
a
yes, it’s live. This is the site url. Thanks
f
the code looks good
o
@fresh-football-47124 @astonishing-market-55169 anything else we can try here?
f
I didn't see any active experiments - but it looks like it is working