Skip to content
Last updated

LinkedIn Export Integration

You can export job results from Treasure Data directly to LinkedIn. You can use this export data connector to create Data Management Platform (DMP) Segments, and upload or update Audience Lists dynamically to your Matched Audiences. The LinkedIn Export Connector supports the following features:

  • Auto-create a new DMP Segment, if the Segment does not exist.
  • Add or remove contacts or accounts from a DMP Segment.
  • Auto-detect and hash the user email, if the value is not hashed.
  • Specify an option to skip or stop on invalid values.

Prerequisites

  • Basic knowledge of Treasure Data
  • A valid LinkedIn Ad Account account
  • Authorized Treasure Data account access to LinkedIn advertiser account

Requirements, Limitations, and Behavior

  • Plain and masked (hashed) emails can be in the same column of data. Plain emails are hashed before sending to LinkedIn.
  • LinkedIn limits the life span of Refresh Token to 365 days. After one year, you must create a new Authentication to continue uploading data.
  • Your Audience Count can take up to 48 hours to finish uploading completely. When users and companies are added to a DMP segment, the initial matching process can take up to 48 hours to resolve the IDs into a destination segment. When finished, the Segment status is Ready.

Use the TD Console to Create Your Connection

Create a New Connection

In Treasure Data, you must create and configure the data connection, to be used during export, prior to running your query. As part of the data connection, you provide authentication to access the integration.

  1. Open TD Console.
  2. Navigate to Integrations HubCatalog
  3. Search for and select LinkedIn. Select Create.
  4. The following dialog opens.
  5. Select Click here to connect to a new account. You are redirected to LinkedIn to log in, if you haven't logged in yet, or to the Consent page to grant access to Treasure Data.
  6. You will be redirected back to TD console. Repeat the first step (Create a new connection) and choose your new OAuth connection.
  7. Select Continue and name your new LinkedIn connection.  
  8. Select Done.

Configure Export Results in Your Data Connection

In this step, you create or reuse a query. In the query, you configure the data connection. Sometimes, you need to define the column mapping in the query.

Configure the Connection by Specifying the Parameters

  1. Open the TD Console.
  2. Navigate to Data Workbench > Queries.
  3. Select the query that you plan to use to export data.
  4. Select Export Results located at top of your query editor. The Choose Integration dialog opens.

You have two options when selecting a connection to use to export the results, using an existing connection or creating a new one.

Use an Existing Connection

  1. Type the connection name in the search box to filter.
  2. Select your connection.
  3. The Export Results dialog opens.
  4. Enter your Ad Account ID.
  5. Enter your Segment Name. Or, if you would rather enter a segment ID, enter the Segment ID then select the Using Segment ID checkbox.
  6. Select Done.

Create a New LinkedIn Connection

  1. Select New Integration and select LinkedIn from Type dropdown.
  2. The Create Integration dialog opens.
  3. Select the Catalog link to go to the Catalog page.
  4. Complete the steps described previously in "Create a new connection", including the creation of an OAuth connection.
  5. Enter the required credentials for your new LinkedIn connection.

Complete the Export Results

Set the following parameters and select Done.

ParametersDescription
Ad Account ID (required)Your Ad Account ID
Audience TypeContact List (Users) or Account List (Companies)
Segment NameDMP Segment name
Using Segment IDSelect the checkbox if you are using the Segment ID instead of the Segment Name.
Segment IDDMP Segment ID
Segment Description (optional)DMP Segment description
DMP Segment ModeAdd or Remove. If mode = Add and Segment Name does not exist, a DMP with the provided name will be created.
Ignore Invalid RecordsOption to ignore invalid rows and to continue importing others.  Invalid rows are listed in the job log. If this option is not selected (by default), jobs terminate when an invalid record is encountered and uploaded data is not reverted.

Column Name for the Query

The LinkedIn data connector understands and interprets the following columns and data types. You must modify alias column names to match with the following specified columns.

If a column does not have a value, the job fails.

The following table describes the columns available for LinkedIn export integration:

Column nameTypeRequiredDescription

email

string

optional

Applicable for Contact List (Users). User's emails, SHA256 hashed emails or SHA512 hashed emails. User's email will be SHA256 hashed before sending to LinkedIn.

An input request will be validated and it will fail if the following validation rules are not met:

  • An input request must provide at least one valid email, google_aid, apple_idfa OR
  • A valid first_name and last_name
google_aidstringoptionalA plain text string with a maximum length of 32 characters and all in lower case. For example, cdda802e-fb9c-47ad-0794d394c912
apple_idfastringoptionalA plain text string with a maximum length of 32 characters and all upper case. For example, EA7583CD-A667-48BC-B806-42ECB2B48606.
first_namestringoptionalA plain text string with a maximum length of 35 characters, no special characters representing the first name of the contact to match, e.g., Mike
last_namestringoptionalA plain text string with a maximum length of 35 characters, no special characters representing the last name of the contact to match, e.g., Smith
companystringoptionalA plain text string with a maximum length of 50 characters, no special characters representing the company name of the contact to match, e.g., Microsoft Corporation
titlestringoptionalA plain text string with a maximum length of 50 characters, no special characters representing the title name of the contact to match, e.g., Software Engineer
countrystringoptionalISO standardized two letter country code, e.g., US

company_name

string

optional

Applicable for Account List (Companies). A string representing the company name of this company.

An input request will be validated and it will fail if the following validation rules are not met:

  • An input request must provide at least one of the following:
    • company_name
    • organization_urn
    • company_website_domain
    • company_email_domain
    • company_page_url
company_website_domainstringoptionalThe company website domain.
company_email_domainstringoptionalThe company email domain (sometimes different from the website domain).
organization_urnstringoptionalThe LinkedIn company page urn of this particular company, e.g., urn:li:organizationUrn:123
company_page_urlstringoptionalThe LinkedIn company page url of this particular company with max length 100 characters, e.g., linkedin.com/company/microsoft
stock_symbolstringoptionalThe stock symbol of this particular company with max length 5 letters, e.g., MSFT
citystringoptionalThe city of this particular company with max length 50 letters, e.g., San Francisco
statestringoptionalThe state or province of this particular company with max length 50 letters, e.g., California or CA
company_countrystringoptionalISO standardized two letter country code, e.g., US
postal_codestringoptionalThe postal code of this particular company with max length 20 letters, e.g., 94103
industrystringoptionalIndustry name with a maximum length of 50 characters, e.g., Technology
industry_twostringoptional
industry_threestringoptional

Example Queries to Populate LinkedIn Data

From Treasure Data, run the following query with export results into a connection for LinkedIn:

The following example query uploads all emails to the existing DMP Segment specified by Segment Name if DMP Segment Mode is specified as Add. Or a new DMP Segment with the specified name will be created before uploading hashed emails.

SELECT
 user_email AS email, google_aid, first_name, last_name
FROM
 my_table;

The following example query uploads Account List to specified DMP Segment if DMP Segment Mode is specified as Add

SELECT
 company_name,
 company_website_domain
FROM
 company_info

Use of Scheduled Jobs for Export (Optional)

You can use Scheduled Jobs with Result Export to periodically write the output result to a target destination that you specify.

Activate a Segment in Audience Studio

You can also send segment data to the target platform by creating an activation in the Audience Studio.

  1. Navigate to Audience Studio.
  2. Select a parent segment.
  3. Open the target segment, right-mouse click, and then select Create Activation.
  4. In the Details panel, enter an Activation name and configure the activation according to the previous section on Configuration Parameters.
  5. Customize the activation output in the Output Mapping panel.

  • Attribute Columns
    • Select Export All Columns to export all columns without making any changes.
    • Select + Add Columns to add specific columns for the export. The Output Column Name pre-populates with the same Source column name. You can update the Output Column Name. Continue to select + Add Columnsto add new columns for your activation output.
  • String Builder
    • + Add string to create strings for export. Select from the following values:
      • String: Choose any value; use text to create a custom value.
      • Timestamp: The date and time of the export.
      • Segment Id: The segment ID number.
      • Segment Name: The segment name.
      • Audience Id: The parent segment number.
  1. Set a Schedule.

  • Select the values to define your schedule and optionally include email notifications.
  1. Select Create.

(Optional) Export Integration Using the CLI

You can also use the TD Toolbelt to export results to WhatsApp Business. Specify the information you want to export to WhatsApp Business as the --result option of the td query command (see TD Toolbelt Query Commands). The option is formatted as JSON, and here is the general structure:

    {  "clientId": your client id,  "clientSecret": your client secret,  "refreshToken": your refresh token,  "adAccountId": your adAccount ID,  "audienceType": "contact_list" or "account_list",  "segmentName": your segment name,  "segmentId": null,  "usingSegmentId": false or true,  "segmentDescription": your description,  "mode": "add" or "remove",  "ignoreInvalidRecords": true,  "oauthWarningFlag": null}

See Also