Use this guide to connect your SQL database to Supermetrics, and seamlessly add its data to your reports. The database connector is only available in Google Sheets.
Use the database connector to connect to a data source Supermetrics doesn't support at the moment, and also for custom in-house data. Then, transform or combine data before adding it to your reports.
Tables that contain all data in the database and Views that contain the results of a query in a virtual table are supported.
SSH connections and write-specific SQL functions are not supported for the SQL database connector.
Supported database types:
- Microsoft SQL Server
- Amazon Redshift
- Google Cloud SQL for MySQL
- Microsoft Azure SQL
Before you begin
Check the access requirements with your database administrator before using the database connector.
Database connector configuration
Before connecting, make sure you have the following information available:
- DB type – The database type or technology being used
- DB address – IP or URL to the SQL server
- DB port – Port number the server is expecting connections through
- Database name – Name of the data based to connect to
- Username – Account that has permissions to access the database
- Password – Password for the account
- Use SSL – Setting that allows SSL to be used, if the server connection requires it.
To use Supermetrics with your database, your database needs to accept connections from specific IP addresses. See the list of IP addresses to allowlist for database connections.
Make sure you've installed the Supermetrics add-on before you connect.
- Open a new Google Sheets file.
- Navigate to Extensions → Supermetrics → Launch sidebar to open Supermetrics.
- Click Create new query.
- Under Data source, select Database.
- Fill in the information for your connection. See “Database connector configuration” above for more details.
- Click Test connection to verify the configuration.
- Click Save.
- Write your SQL statement in the Query SQL box.
- Click Get Data to Table to pull your data.
- Learn about advanced settings, best practices, and troubleshooting tips for Supermetrics for Google Sheets.
- Learn how to use the "Combine new results with old" setting in Google Sheets.