Search API Connector Documentation
Import LinkedIn Ads Data to Google Sheets
In this guide, we will pull data from the LinkedIn API directly into Google Sheets, using the API Connector add-on for Sheets.
The LinkedIn API limits data for privacy reasons; don't expect a way to pull out profile information for anyone but yourself. However, this API is perfect for pulling out advertising performance data from the LinkedIn Ads Reporting API.
- Before You Begin
- Part 1: Connect to the LinkedIn Ads API
- Part 2: Pull Data from LinkedIn Ads to Sheets
- Part 3: Create a Custom API Request
- Part 4: Handle Pagination
- Part 5: Notes
- Part 6: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Connect to the LinkedIn Ads API
The easiest way to get started with the LinkedIn Ads API is through API Connector’s built-in integration.
- Select LinkedIn Ads from the drop-down list of applications
- Under Authorization, click Connect to LinkedIn
- You will be directed to LinkedIn and asked to authorize the connection. Click Allow.
- You'll now be returned to your Google Sheet, and can verify that your LinkedIn API connection is active.
Part 2: Pull Data from LinkedIn Ads to Sheets
Now that we’re connected, let’s pull some data into Sheets.
- In the Endpoint section, choose
/adAnalytics?q=analyticsto get reporting data in your sheet.
- In the Request parameters section, select one or more of your accounts from the dropdown menu.
- Fill in the other required parameters:
dateRange, select fixed dates from the calendar input or use dynamic values from the cells in your sheet.
- Optionally enter the text
projectionfield. This will retrieve some additional useful fields like campaign names (without using projection, you'll get just the IDs).
- Click Edit fields to select just the fields you want and assign them to specific columns in your report.
- Run your request.
Part 3: Create a Custom API Request
Alternatively, you can create a custom request instead of using API Connector’s built-in integration, using any of the API URLs shown in the API documentation. Here's a complete example request using LinkedIn's X-Restli protocol and their new versioned API:
- Request URL:
Part 4: Handle Pagination
By default, LinkedIn's
/adAnalytics endpoint will return just 1000 records. To return more, apply API Connector's automatic pagination handling as follows
next page URL
- Next page path:
- Run until: choose when to stop fetching data
Part 5: Notes
- Use the visual field editor to re-arrange columns (just click Edit Fields before running your request).
- LinkedIn sends back dates split into separate year, month, and day fields. To transform these into a regular Sheets date, set a data destination of cell B1, and then add the following function into cell A1:
=arrayformula(if(J2:J<>"", date(J2:J,H2:H,I2:I),"")). The function assumes years are in column J, months are in H, and days are in I; adjust as needed.
- To view or manage the connection on LinkedIn, click here: https://www.linkedin.com/psettings/permitted-services
Part 6: API Documentation
Official API documentation: https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ads-reporting