Has anyone successfully been able to integrate Amp...
# ask-questions
a
Has anyone successfully been able to integrate Amplitude into Growthbook? I was able to get Amplitude to dump data into BigQuery, and add that as a data source. When testing my custom SQL/BigQuery query via GB's metric page, it is successfully able to pull events. However, when I try to add the metric to an experiment, Growthbook seems to wrap my sql query in another query - only it doesn't quite follow the BigQuery syntax:
Copy code
WITH
      
      
    
    __rawExperiment AS (
      SELECT
  user_id as user_id,
  event_time as timestamp,
  event_properties:experiment_id as experiment_id,
  event_properties:variation_id as variation_id,
  device_family as device,
  os_name as os,
  country,
  paying
FROM
...
I'm getting a syntax error because BigQuery doesn't understand the use of a colon (:) to de-nest JSON objects like in
event_properties:experiment_id
I'm wondering if I'm missing something, because I can't actually edit this query. It seems to me like GB is confusing BigQuery with some other syntax, but you can only add Amplitude events through some external data lake (no direct integration).
b
Hi Haris, I can try to offer some help. The SQL query you pasted appears to be an Experiment Assignment Query (EAQ), which you should be able to edit here: Left navbar --> Metrics and data --> Data sources --> Select the BQ in question --> "Experiment Assignment Queries" section. When the SQL works fine for the Metrics themselves but not within the context of an Experiment, usually it's the Experiment Assignment Query at fault. I agree with you; I have not seen the
:
syntax in a BQ-related EAQ before. More docs on EAQs: https://docs.growthbook.io/app/datasources#experiment-assignment-queries
👍 1
Did you follow our BigQuery setup guide? https://docs.growthbook.io/guide/bigquery We should have automatically created the EAQ for you if you followed that guide.
You'll need to change the 2 lines that contain the colons. Maybe try this?
Copy code
experiment_id_param.value.string_value AS experiment_id,
      variation_id_param.value.int_value AS variation_id,
a
I’ll try the change on the Experiment Assignment Query, thanks!