Skip to main content
Customer data often sits in Snowflake, outside Kameleoon, so a campaign can’t target visitors on that data without a connection. A Data Ingestion Task runs a SQL query on a schedule and keeps the result as an audience in Kameleoon. You then build a segment from that audience, so a campaign can reach visitors based on warehouse data.
Data warehouse integrations are available as a premium add-on for the Web Experimentation and Feature Experimentation module. Contact your Customer Success Manager for more information.

Set up audience targeting

To target visitors with audiences from Snowflake, activate the source feature, create Data Ingestion Tasks, and build segments from the collected data. Before you begin, enable the Snowflake integration for your project.
  1. Activate the feature: In the selected project’s configuration, expand Use Snowflake as a source. Its status shows Enabled when the feature is on.
  1. Create Data Ingestion Tasks: With the feature activated, click Add new task to create a Data Ingestion Task. Each task runs your query at the frequency you set.
  2. Validate: After you fill in a task, click Confirm to create it. Repeat step 2 to create more tasks. After you configure your tasks, click Validate to save and apply your configuration settings.
  3. Create custom data: Kameleoon runs each query at the frequency you set and collects the data. To use the collected data, create custom data.
  4. Create a segment: Build a segment from your custom data to target the visitors in the collected data.

Data Ingestion Tasks

A Data Ingestion Task runs a SQL query against your Snowflake database at the frequency you set, and Kameleoon keeps the result as an audience. You reach that audience through custom data and segments, as described in Targeting your imported audiences.

Create a Data Ingestion Task

Create a Data Ingestion Task when you want Kameleoon to pull an audience from Snowflake.
  1. Click Add new task.
  1. Complete the form:
    • Name (Required): Enter a unique, descriptive name that identifies the task’s purpose.
    • Warehouse (Required): Enter the name of your Snowflake warehouse.
    • Database (Required): Enter the name of the Snowflake database that contains the data you import.
    • Frequency (Required): Choose how often the task runs and retrieves data from Snowflake, for example once per day.
    • Query (Required): Enter the SQL query that retrieves the audience. The query must follow this format: SELECT visitor_id, attribute_1, ..., attribute_N FROM your_events_table
    • visitor_id (Required): The column that holds your visitors’ unique identifier.
    • attribute_ fields: These are optional, and you use them for advanced targeting. Target your imported audiences describes these use cases.
Column names can contain only letters, numbers, and underscores (_). A column name can’t start with a number. Columns must appear in the exact order specified, with visitor_id first, followed by any optional attributes. Otherwise the integration doesn’t work correctly.
  1. Click Confirm to create the Data Ingestion Task.

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.

How audience polling works

Unlike conversion goal polling, a Data Ingestion Task reruns its full SQL query on every scheduled poll instead of tracking a starting point and pulling only new records. Kameleoon compares each poll’s result against the previous result and sends only the differences, the visitors added to or removed from the audience, to your Kameleoon project. Because every poll already returns the complete, current audience, your Snowflake query never needs to filter by timestamp. After you create a task, Kameleoon starts polling your warehouse, and the polled data is available for targeting right away. For web experiments, you read it through the Activation API. For Feature Experimentation, you read it through the Kameleoon SDKs.

Failed polls and query changes

A failed poll leaves the audience unchanged, but a query that still runs can change the audience without an error. If a poll fails, Kameleoon logs the failure. The audience keeps the visitors from the last successful poll until a later poll succeeds. If the query itself fails, for example because it contains invalid SQL, the poll fails in the same way, and the audience keeps its previous visitors. If the query still runs but returns different rows, Kameleoon adds and removes visitors to match the new result, and no error appears. After you rename or restructure a table or view that a query reads, run the query again, as described in Run your query before ingestion, to confirm that it returns the columns you expect.

Ingestion timeframe

Some Snowflake polling, such as conversion goal polling, tracks a moving time window and allows a configurable delay for an event to become available in your warehouse before that window passes it by. Data Ingestion Tasks rerun the full audience query on each poll rather than tracking a time window, so they pick up whatever data exists in Snowflake at that moment and aren’t affected by this delay. Contact your Customer Success Manager if you have questions about how ingestion timing affects your audience data.

Update a Data Ingestion Task

Update a Data Ingestion Task when you need to change its name, frequency, warehouse, database, or query.
  1. Select the task: Select a Data Ingestion Task from the dropdown menu.
  1. Edit task details: Modify the fields you want to update.
  2. Confirm changes: Click Confirm to save the changes to the Data Ingestion Task.

Delete a Data Ingestion Task

Delete a Data Ingestion Task that you no longer need. Before you delete a task, delete its associated custom data.
  1. Select the task: Select a Data Ingestion Task from the dropdown menu.
  2. Initiate deletion: Click Delete ingestion task.
  1. 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 it with custom data and segments. Choose one of two approaches:
  • Pre-built audience: Target a whole audience from a task, for example all visitors in “The Londoners.” Create one custom data entry that lists every task audience, then build segments from it.
  • Visitor attribute: Target an attribute with many values, for example each visitor’s city of birth. Add the attribute to the SQL query as a field after visitor_id, then create a custom data entry that holds its value.
The retrieval method depends on your Kameleoon setup. Feature Experimentation uses Kameleoon SDK methods. Web Experimentation, alone or together with Feature Experimentation, uses custom JavaScript code. Target your imported audiences gives the setup steps and code samples for each approach.