https://www.growthbook.io/ logo
#give-feedback
Title
# give-feedback
c

creamy-sugar-16875

08/25/2023, 11:11 PM
Hi, I'm testing out Growth Book for the first time and I'm getting a query error. The error is happening because the query that Growth Book is trying to use is putting the
Project Id
twice (
projectId.projectId.dataset
) instead of putting just the
Project Id
and the
Dataset
(
projectId.dataset
). Is there a way that I can edit the SQL query?
f

future-teacher-7046

08/25/2023, 11:13 PM
Hi Nathan, sorry about that. If you go to your Datasource (under Metrics and Data in the left nav), you should see the assignment queries listed (there should be a logged in one and an anonymous one). You can edit the queries there
c

creamy-sugar-16875

08/25/2023, 11:33 PM
Thanks Jeremy, that's what I was looking for. So I'm not getting the error anymore but the query is returning empty.
f

future-teacher-7046

08/25/2023, 11:37 PM
Are you already tracking experiment viewed events with GA4? If so, you might need to modify the event name in the query to match what you're sending in the GA tracking call
c

creamy-sugar-16875

08/25/2023, 11:41 PM
Ok thanks I believe I see what you mean. If I have any further issues I'll comment back here after the weekend. I appreciate your help thus far. 🙏🏾
Hey @future-teacher-7046, so I made the updates and we now have a demo A/B test running and collecting data. In order for the query to return data for our A/B test I had to remove this line
_TABLE_SUFFIX BETWEEN '{{date startDateISO "yyyyMMdd"}}' AND '{{date endDateISO "yyyyMMdd"}}'
from our SQL query and it's now returning results. I'm not 100% sure if this line is necessary or not but when it's included the query return with no data. Just looking to get your input on if removing this line will cause any issues or if you know why this line is causing us issues?
h

helpful-application-7107

09/01/2023, 8:21 PM
That part of the query should just help us run more performant queries but it is not strictly necessary. It'd be good if it worked so that we wouldn't have to scan as many tables, but if it's causing a problem then removing it won't necessarily be problematic. One thing you could do is add that line back in, run the demo analysis again, and then share the generated Query with me here and I maybe can help you figure out what's going on from there.
c

creamy-sugar-16875

09/01/2023, 8:38 PM
Copy code
WITH
  __table as (
    SELECT
      user_pseudo_id as anonymous_id,
      TIMESTAMP_MICROS(event_timestamp) as timestamp,
      experiment_id_param.value.string_value AS experiment_id,
      variation_id_param.value.int_value AS variation_id,
      geo.country as country,
      traffic_source.source as source,
      traffic_source.medium as medium,
      device.category as device,
      device.web_info.browser as browser,
      device.operating_system as os
    FROM
      `placeholder`,
      UNNEST (event_params) AS experiment_id_param,
      UNNEST (event_params) AS variation_id_param
    WHERE
      _TABLE_SUFFIX BETWEEN '20220901' AND '20230903'
      AND event_name = 'experiment_viewed'
      AND experiment_id_param.key = 'experiment_id'
      AND variation_id_param.key = 'variation_id'
      AND user_pseudo_id is not null
  )
SELECT
  *
FROM
  __table
LIMIT
  5
10 Views