Skip to main content
You can target visitors with attributes from your Amazon Redshift tables. Kameleoon imports the result of each query as an audience, and you use that audience as a targeting condition in your campaigns. To use the integration, first enable the Amazon Redshift integration for your project and turn on the Use Amazon Redshift as a source option.
Data warehouse integrations are available as a premium add-on for Kameleoon’s Web Experimentation and Feature Experimentation module. For more information, contact your Customer Success Manager.

Set up audience targeting

To target visitors with an audience from Amazon Redshift, complete the following steps in order.
  1. Open the feature: In the selected project’s configuration, open Use Amazon Redshift as a source. Its status shows Enabled when the feature is active.
  2. Create Data Ingestion Tasks: With the feature enabled, click Add new task to create a Data Ingestion Task. For the fields, see Data Ingestion Tasks.
  3. Confirm and validate: Click Confirm to save each task, and create more tasks by repeating step 2. When you finish, click Validate to save and apply your configuration settings.
  4. Create custom data: Kameleoon starts collecting data at the frequency you set by running each query on your Amazon Redshift instance. To use the collected data, create custom data.
  5. Create a segment: Create a segment based on your custom data to target visitors with the collected data.

Data Ingestion Tasks

A Data Ingestion Task runs a SQL query against your Redshift database at the frequency you set, and it imports the result as an audience. Each task needs the query, the cluster details, and a run frequency. Kameleoon polls your warehouse at the frequency you set for each task. When a poll succeeds, the audience is available for targeting in your campaigns. You can use the polled data with Kameleoon’s Activation API for web experiments and Kameleoon’s SDKs for Feature Experimentation. If a poll fails, Kameleoon logs the failure, and the audience keeps the membership from the last successful poll until a later poll succeeds.

Creating a Data Ingestion Task

To create a Data Ingestion Task:
  1. Click Add new task.
  2. Complete the form:
    • Name (Required): Give your task a unique and descriptive name to identify its purpose.
    • Redshift cluster type (Required): Specify whether you use a provisioned or serverless Redshift cluster. If you choose Provisioned, you must provide your cluster ID. If you choose Serverless, you must provide your namespace and workgroup.
    • Redshift AWS region (Required): your Redshift cluster’s region code. You can find this in your AWS console. Example: us-west-2.
    • Database (Required): the name of the Redshift database containing the data you are ingesting.
    • Frequency (Required): Specify how often you want the task to run and retrieve data from Amazon Redshift (for example, per day).
    • Query (Required): Provide the SQL query that retrieves the audience from your Amazon Redshift database. The query must follow this specific format: SELECT visitor_id, attribute_1, ..., attribute_N FROM your_events_table.
    • attribute_ fields: These are optional, and you can use them for advanced targeting scenarios. Learn more about these advanced use cases in Target your imported audiences.
    • visitor_id: the identifier Kameleoon uses to look up each visitor’s audience data. Use the same value you pass when you retrieve the audience in your code, which is either the Kameleoon visitor code or, if you pass one, your own warehouseKey. For guidance on choosing an identifier, see Visitor identification.
  3. Click Confirm to create the Data Ingestion Task.
Add new data ingestion task form, with fields for the task name, Redshift cluster type, Redshift AWS region, database, frequency and query.

Guidelines

Column naming
Column names can only contain letters, numbers, and underscores (_). They can’t start with a number.
Column order
The columns must appear in the exact order specified (visitor_id, followed by optional attributes) for the integration to function correctly.

Run your query before ingestion

Before saving your ingestion task, you can test your query directly in Kameleoon. Testing allows you to:
  • Verify the connection in real time.
  • Confirm your credentials and access rights are correct, which helps detect issues immediately, without having to wait for the first data import.
  • Validate your data’s structure and accessibility.
You can run a simple query to ensure Kameleoon can access the right databases and tables. You can also download a small sample of the dataset to confirm that the schema, permissions, and contents match your expectations.

Updating a Data Ingestion Task

To update a Data Ingestion Task:
  1. Select the task: Select a Data Ingestion Task from the dropdown menu.
  2. Edit task details: Modify the fields you want to update, such as the task’s name, frequency, Redshift cluster, region, database, or query.
  3. Confirm changes: Click Confirm to save the changes to the Data Ingestion Task.

Deleting a Data Ingestion Task

Before you delete a Data Ingestion Task, delete its associated custom data. To delete a Data Ingestion Task:
Data Ingestion Task dropdown in the Amazon Redshift settings, listing the existing task 205 - First Redshift ingestion.
  1. Select the task: Select a Data Ingestion Task from the dropdown menu.
  2. Initiate deletion: Click Delete data ingestion task.
  3. Confirm deletion: Click Confirm to delete the selected Data Ingestion Task.

Targeting your imported audiences

Each Data Ingestion Task defines an audience, and you target that audience through a custom data entry and a segment. Choose the approach that matches what you want to target:
  • A pre-built audience: For example, all visitors born in London. Create one custom data entry that lists every Ingestion Task audience, then build a segment from it.
  • A visitor attribute: For example, the birth city of each visitor, with many different values. Add the attribute as a field after visitor_id in your query, then create a custom data entry that holds its value.
The method that reads the custom data depends on the product. Feature Experimentation alone uses the Kameleoon SDK method. Web Experimentation, alone or alongside Feature Experimentation, uses custom JavaScript code. For the setup steps and code samples for each approach, see Target your imported audiences.