Cohort
HomeSign in
  • WHAT IS COHORT?
  • WHAT'S NEW?
  • Concepts
    • Experience Space
    • Campaigns
    • Standalone campaign
    • Rewards
    • Users
    • Experiences
  • GETTING STARTED
    • Overview
    • Admin Authentication
      • Setup a SAML SSO provider
      • Setup a OIDC SSO provider
    • Test mode
    • Adding Team members
    • Languages Admin interface
    • Languages User interfaces
  • Campaigns
    • Overview
    • Create a campaign
      • Challenge campaign
      • Store campaign
      • Airdrop campaign
      • Standalone campaign
    • Manage a campaign
      • Consult the indicators
      • Share a campaign
      • See the participants
      • Modify a campaign
      • End a campaign
      • Archive a campaign
      • Delete a campaign
    • Campaign display mode
  • REWARDS
    • Overview
    • Perk
      • Create a Perk
      • Manage a Perk
    • Digital Asset
      • Create a Digital Asset
      • Manage a Digital Asset
    • Rewards Distribution mode
  • USER INTERFACES
    • Experience Space
      • Configure your Experience Space branding
      • Customize your Experience Space
      • Customize your Membership Pass
    • Standalone campaigns
  • USERS
    • Overview
    • Import and export users
    • Custom user properties
    • Lists and Segments
    • Badges
  • Integrations
    • Apps
      • Brevo
      • Comarch
      • Facebook
      • Klaviyo
      • Maxxing
      • PostgreSQL
      • Salesforce
      • Shopify
      • Spotify
      • Talon.One
      • Tiktok
      • Typeform
      • Youtube
  • USER ACTIONS
    • Overview
    • Native Applications
    • Social Media
    • Lifestyle
    • Quizz and Surveys
  • INDICATORS
    • Overview
    • General indicators
    • Users indicators
    • Campaigns indicators
  • Developers
    • Overview
    • Embed
    • Merchants API
    • Campaign diffusion
  • Security
    • Security at Cohort
  • GLOSSARY
Powered by GitBook
On this page
  • Installation
  • Import Users from PostgreSQL
  1. Integrations
  2. Apps

PostgreSQL

PreviousMaxxingNextSalesforce

Last updated 1 month ago

Connection type: SQL Credentials

Features:

  • Import Users from PostgreSQL to Cohort

Installation

  • Contact your PostgreSQL administrator to create a Postgres user for the Cohort integration. This user must have read access to the table or view containing the Users.

  • Provide the connection URL for that user to the database. It usually looks like this: postgresql://[user[:password]@][netloc][:port][/dbname][?param1=value1&...]

  • Provide the schema that contains the data

  • Provide the SSL Certificate for connecting securely to the database (recommended)

Import Users from PostgreSQL

  • Activate the Enable user import toggle

  • Type the SQL query that should be executed to fetch the users.

    • Only top-level SELECT queries are supported

    • The query must returned one row per user to import

    • The query must return an email column containing the email of the user

    • The query must return one column per User Property that must be imported into Cohort

    • If the query returns an updated_at datetime column, it will be used to fetch only the users that have changed since the last import ran. This is highly recommended if you have a large number of users for performance and cost.

    • You can use joins, subqueries or any other valid Postsgres query that will return one row per user. If your query is to complex and expensive to compute, we recommend making a materialized view in your database and querying the view.

  • Click on Run Query to test your query

  • Match the columns with the User Properties you want to import

  • By default the query will be ran every day at midnight UTC to import new users, as long as the sync is active. If you would like to change the frequency or scheduling, please get in touch with your account manager.