Skip to content

Mailchimp

Mailchimp is an all-in-one marketing platform that helps businesses manage and talk to their clients, customers, and other interested parties through email marketing campaigns, automated messages, and targeted ads.

Bruin supports Mailchimp as a source for Ingestr assets, and you can use it to ingest data from Mailchimp into your data warehouse.

In order to set up Mailchimp connection, you need to add a configuration item in the .bruin.yml file and in asset file. You need the api_key and server. For details on how to obtain these credentials, please refer here.

Follow the steps below to correctly set up Mailchimp as a data source and run ingestion.

Step 1: Add a connection to .bruin.yml file

To connect to Mailchimp, you need to add a configuration item to the connections section of the .bruin.yml file. This configuration must comply with the following schema:

yaml
    connections:
      mailchimp:
        - name: "connection_name"
          api_key: "your_api_key"
          server: "us10"
  • api_key: The API key used for authentication with the Mailchimp API.
  • server: The server prefix for your Mailchimp account (e.g., us10, us19).

Step 2: Create an asset file for data ingestion

To ingest data from Mailchimp, you need to create an asset configuration file. This file defines the data flow from the source to the destination. Create a YAML file (e.g., mailchimp_ingestion.yml) inside the assets folder and add the following content:

yaml
name: public.mailchimp
type: ingestr
connection: postgres

parameters:
  source_connection: connection_name
  source_table: 'campaigns'

  destination: postgres
  • name: The name of the asset.
  • type: Specifies the type of the asset. Set this to ingestr to use the ingestr data pipeline.
  • connection: This is the destination connection, which defines where the data should be stored. For example: postgres indicates that the ingested data will be stored in a Postgres database.
  • source_connection: The name of the mailchimp connection defined in .bruin.yml.
  • source_table: The name of the data table in mailchimp that you want to ingest. For example, campaigns is the table of mailchimp that you want to ingest.

Available Source Tables

TablePKInc KeyInc StrategyDetails
account--replaceRetrieves account information including company details, account tier, and contact information.
account_exports--replaceRetrieves account export information.
audiencesiddate_createdmergeRetrieves audience (list) information including subscriber counts and list settings.
authorized_appsid-replaceRetrieves third-party applications authorized to access your account.
automationsidcreate_timemergeRetrieves automated email workflows and their configurations.
batches--replaceRetrieves batch operation status and results.
campaign_foldersid-replaceRetrieves folders used to organize campaigns.
campaignsidcreate_timemergeRetrieves email campaigns including their content, settings, and metadata.
chimp_chatter--replaceRetrieves recent activity feed from your Mailchimp account.
connected_sitesidupdated_atmergeRetrieves websites connected to your Mailchimp account.
conversationsidlast_message.timestampmergeRetrieves conversation threads from connected channels.
ecommerce_storesidupdated_atmergeRetrieves e-commerce store information including products and orders.
facebook_adsidupdated_atmergeRetrieves Facebook ad campaigns managed through Mailchimp.
landing_pagesidupdated_atmergeRetrieves landing pages created in Mailchimp.
lists_activity--replaceRetrieves recent activity for list members. Includes audiences_id reference.
lists_clients--replaceRetrieves email clients used by list members. Includes audiences_id reference.
lists_growth_history--replaceRetrieves historical growth data for the list. Includes audiences_id reference.
lists_interest_categories--replaceRetrieves interest categories (groups) for the list. Includes audiences_id reference.
lists_locations--replaceRetrieves geographic locations of list members. Includes audiences_id reference.
lists_merge_fields--replaceRetrieves custom merge fields defined for the list. Includes audiences_id reference.
lists_segments--replaceRetrieves segments (filtered subsets) of the list. Includes audiences_id reference.
reportsidsend_timemergeRetrieves campaign performance reports and analytics.
reports_advice--replaceRetrieves feedback and suggestions for improving campaign performance. Includes reports_id reference.
reports_domain_performance--replaceRetrieves email performance broken down by email domain. Includes reports_id reference.
reports_locations--replaceRetrieves geographic location data for campaign opens. Includes reports_id reference.
reports_sent_to--replaceRetrieves list of recipients who were sent the campaign. Includes reports_id reference.
reports_sub_reports--replaceRetrieves sub-reports for A/B test campaigns. Includes reports_id reference.
reports_unsubscribed--replaceRetrieves list of members who unsubscribed from the campaign. Includes reports_id reference.

Step 3: Run asset to ingest data

bruin run assets/mailchimp_ingestion.yml

As a result of this command, Bruin will ingest data from the given Mailchimp table into your Postgres database.