And I'm using custom data source (MySQL), but don'...
# ask-questions
b
And I'm using custom data source (MySQL), but don't now how to send tracking data to the data source
r
Our official support hours are 6:30am - 5pm Pacific Time, Monday through Friday. You may occasionally hear from us outside of these hours. Your support request has been logged in our system. Our support team will get back to you very soon!
f
Tracking events for the experiment exposure are sent via the trackingCallback method
other events use whatever event tracking you already have
you can use any db or event tracker you like - Jitsu, Rudderstack, Segment, whatever
b
Hi @fresh-football-47124, I'm using my own MySQL database, so that means I need to insert data to DB manually, inside of trackingCallback method, is this correct ?
r
Hi, that's correct. In the screenshot you sent, there's a comment that says
Copy code
// TODO: Use your real analytics tracking system
The code to send data to MySQL would go there. In the screenshot you sent, info is only being printed, not stored in the database.
b
Hi @brief-honey-45610, I tried to create my own MySQL data source to test the query, but always got the error when executing it. Here are my design and implementation, could you please take a look and advise if anything wrong here ? many thanks
r
Hi, as I'm looking into this I noticed your SQL query doesn't end in a semi-colon (;). Could you try adding that and let me know if you still get the error? You may also need to prepend the column names in your SQL query with the table name, like ​`viewed­_experiment.user­_id`​
b
Hi @brief-honey-45610, tried both suggestions and I still can't execute the query. Add ; to the end -> error "Don't end your SQL statements with semicolons since it will break our generated queries" Add table name before column name -> error "You have an error in your SQL syntax;". Btw we're using the MySQL version 5.6, is this an issue with the compatibility version?
b
Hi David, thanks for trying my suggestions. It was important to rule them out as simple causes of the issue. Let me check with the team about a potential version incompatibility next. I'll update you here once I have more info.
❤️ 1
r
Hi David, unfortunately we don't really have any resources for setting up GrowthBook with MySQL. What are you trying to achieve, specifically? Are you trying to create a metric from scratch?
b
Yes @brief-honey-45610, our system uses PHP and MySQL, and we'd like to setup GrowthBook custom data source with MySQL (as I saw this is an available option for custom data source). We're trying to create and test some metrics for our experiment. Technically, those are some very basic SQL queries so I think it is not a syntax issue, instead of that, I'm thinking about an incompatibility issue with MySQL version, but I can't find the information about of minimum required version on the GrowthBook documentation
f
What mysql version do you have?
I know we require support for CTE, which I think was MySQL 8
b
@fresh-football-47124 we’re using 5.6 version
f
oh man, thats from 2015
b
Yeah I know…
f
ya, let me see if there is a work around
I doubt you’re looking to edit the SQL code in our code base?
👍 1
b
hi @fresh-football-47124 do you have any suggestions to make our system (MySQL 5.6 version) can work with Growthbook. I know version 5.6 doesn't support CTE but I'd like to see if there is any solution. Thank you
r
Hi again, unfortunately we don't know of any way to make MySQL 5.6 work with our system. Is upgrading to at least version 8 and/or using a different data store really not an option?
👍 1