ClearBrain automatically connects to your user data in Heap Analytics via the Heap SQL feature. We collect all your Heap sessions, events, and user data to enable you to predict any user action you've tracked in Heap. 

Step 1: Create a Redshift User for ClearBrain

To connect to your Heap SQL data, you will need to create a user for ClearBrain in your Redshift database (where your Heap SQL data is stored).

Enter the commands below into your SQL client, with a unique username and password that ClearBrain can use to access your Heap data in Redshift.

CREATE USER {CLEARBRAIN_USER_NAME} WITH
PASSWORD '{SOME_SECURE_PASSWORD}';

Step 2: Grant Read access to Redshift User

Once you've created a Redshift user for ClearBrain, you will need to grant it read access to your Heap data in Redshift. 

To do so, please run the following commands in your SQL client.

GRANT SELECT ON ALL TABLES IN SCHEMA {YOUR_SCHEMA_NAME} TO {CLEARBRAIN_USER_NAME}; /* permission to read */

GRANT USAGE ON SCHEMA {YOUR_SCHEMA_NAME} TO {CLEARBRAIN_USER_NAME}; /* permission to read */

Note, {YOUR_SCHEMA_NAME} refers to the schema-folder in which your Heap data is stored in Redshift, and {CLEARBRAIN_USER_NAME} should be the user you created in Step 1.

Step 3: Create a Heap connection in ClearBrain

The final step is to create a Heap Connection in ClearBrain. Start by going to the Connections Tab in ClearBrain, click "New Connection" and select the Heap option.

You'll be presented with a list of form fields to enter:

  • Name: A unique name for your Heap connection that will be displayed in ClearBrain
  • Username: The Redshift user you created in Step 1
  • Password: The password you created for the Redshift user in Step 1
  • Database: The name of your Redshift database in which your Heap data is stored
  • Host: The host path for your Redshift database in which your Heap data is stored
  • Port: The port number of your Redshift database in which your Heap data is stored

Step 4: Processing your data from Heap

After you've created your Heap + ClearBrain connection, we'll start ingesting your user data. We'll unload your data from Redshift, and it will take 24-48 hours to process the data for the first time.

You will be notified automatically by ClearBrain when enough historical data has been collected, and you can start creating predictions in ClearBrain.

Did this answer your question?