-
Notifications
You must be signed in to change notification settings - Fork 4.6k
[ISSUE #72] LinkedIn Ads documentation #30386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
maxi297
merged 10 commits into
master
from
snowflake-native-app/linkedin-ads-documentation
Sep 14, 2023
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
43bb58a
[ISSUE #72] LinkedIn Ads documentation
maxi297 e86992a
Merge with previously created doc
maxi297 e795ad7
Fix
maxi297 2a41ff3
a few edits to the setup guide
brianjlai a80b190
Merge branch 'master' into snowflake-native-app/linkedin-ads-document…
brianjlai ecddf8d
rename to AIRBYTE_LINKEDIN_ADS
brianjlai b3b6c99
Remove duplicated step
maxi297 43b5bda
Adding gif
maxi297 65b60c2
Apply suggestions from code review
maxi297 66b209a
Configuration less dense
maxi297 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
# LinkedIn Ads Connector | ||
|
||
The Airbyte connector for LinkedIn Ads is a Snowflake Native Application that allows you to extract data from your LinkedIn Ads account and load records into a database of your choice within Snowflake. | ||
|
||
 | ||
|
||
> **Info** | ||
> The LinkedIn Ads Connector is in _private preview_ and is subject to further development that may affect setup and configuration of the application. | ||
|
||
# Getting started | ||
|
||
## Prerequisites | ||
A LinkedIn Ads account with permission to access data from accounts you want to sync. | ||
|
||
## Installing the App | ||
|
||
> **Warning** | ||
> Do not refresh the Apps page while the application is being installed. This may cause installation to fail. | ||
|
||
1. Log into your Snowflake account. | ||
2. On the left sidebar, click Marketplace. | ||
maxi297 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
3. Search for `Linkedin Ads Connector` by Airbyte or navigate to https://app.snowflake.com/marketplace/listing/GZTYZ9BCRSJ/airbyte-linkedin-ads-connector-by-airbyte | ||
4. Click `Request`. This will send a request that we will manually service as soon as we can. | ||
5. On the left sidebar, click `Apps`. | ||
6. Under the `Recently Shared with You` section, you should see the `Linkedin Ads Connector by Airbyte`. Click `Get`. | ||
7. Expand `Options`. | ||
1. You can rename the application or leave the default. This is how you will reference the application from a worksheet | ||
maxi297 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
2. Specify the warehouse that the application will be installed to. | ||
8. Click `Get`. | ||
9. Wait for the application to install. Once complete, the pop-up window should automatically close. | ||
|
||
You should now see the application under `Installed Apps`. You may need to refresh the page. | ||
maxi297 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## LinkedIn Ads Account | ||
In order for the Snowflake Native App to query LinkedIn Ads, you will need an account with the right permissions. Please follow [the LinkedIn Ads authentication guide](https://docs.airbyte.com/integrations/sources/linkedin-ads/#set-up-linkedin-ads-authentication-airbyte-open-source) for further information. | ||
|
||
## Snowflake Native App Authorizations | ||
> **Note** | ||
> By default the app will be installed using the name `AIRBYTE_LINKEDIN_ADS`, but if you renamed the app during installation, you will have to use that name as a reference. | ||
|
||
1. Create the database where the app will access the authorization. This database can be different from the database where the sync will output the records. | ||
maxi297 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
CREATE DATABASE <database>; | ||
USE <database>; | ||
``` | ||
|
||
2. The native app will validate the output database and create it if it does not exist. In order to do that, the app needs access to the database: | ||
``` | ||
GRANT CREATE DATABASE ON ACCOUNT TO APPLICATION <app_name>; | ||
``` | ||
|
||
3. We also need to allow outgoing network traffic based on the domain of the source. In the case of LinkedIn Ads, simply run: | ||
maxi297 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
CREATE OR REPLACE NETWORK RULE linkedin_apis_network_rule | ||
MODE = EGRESS | ||
TYPE = HOST_PORT | ||
VALUE_LIST = ('api.linkedin.com', 'www.linkedin.com', 'linkedin.com'); | ||
``` | ||
|
||
> **Note** | ||
> As of 2023-09-13, the [Snowflake documentation](https://docs.snowflake.com/en/sql-reference/sql/create-external-access-integration) mentions that direct external access is a preview feature and that it is `available to all accounts on AWS` which might restrict the number of users able to use the connector. | ||
|
||
4. Once we have external access configured, we need define our authorization/authentication. Provide the credentials to the app as such: | ||
maxi297 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
CREATE OR REPLACE SECRET integration_linkedin_ads_oauth | ||
TYPE = GENERIC_STRING | ||
SECRET_STRING = '{ | ||
"auth_method": "oAuth2.0", | ||
"client_id": <client_id>, | ||
"client_secret": <client_secret>, | ||
"refresh_token": <refresh_token> | ||
}'; | ||
``` | ||
... where `client_id`, `client_secret` and `refresh_token` are strings. For more information, see [the LinkedIn Ads authentication guide](https://docs.airbyte.com/integrations/sources/linkedin-ads/#set-up-linkedin-ads-authentication-airbyte-open-source). | ||
maxi297 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
5. Once the network rule and the secret is defined in Snowflake, we just need to make them available to the app by using an external access integration. | ||
maxi297 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
CREATE OR REPLACE EXTERNAL ACCESS INTEGRATION integration_linkedin_ads | ||
ALLOWED_NETWORK_RULES = (linkedin_apis_network_rule) | ||
ALLOWED_AUTHENTICATION_SECRETS = (integration_linkedin_ads_oauth) | ||
ENABLED = true; | ||
``` | ||
|
||
6. Grant permission for the app to access the integration. | ||
``` | ||
GRANT USAGE ON INTEGRATION integration_linkedin_ads TO APPLICATION AIRBYTE_LINKEDIN_ADS; | ||
``` | ||
|
||
7. Grant permissions for the app to access the database that houses the secret and read the secret. | ||
``` | ||
GRANT USAGE ON DATABASE <your_database> TO APPLICATION AIRBYTE_LINKEDIN_ADS; | ||
GRANT USAGE ON SCHEMA <your_schema> TO APPLICATION AIRBYTE_LINKEDIN_ADS; | ||
GRANT READ ON SECRET integration_linkedin_ads_oauth TO APPLICATION AIRBYTE_LINKEDIN_ADS; | ||
``` | ||
|
||
|
||
## Configure a connection | ||
Once this is all set up, you can now configure a connection. To do so, use the Streamlit app by going in the `Apps` section and selecting `AIRBYTE_LINKEDIN_ADS`. You will have to accept the Anaconda terms in order to use Streamlit. | ||
Once you have access to the app, select `New Connection` and fill the fields as such: | ||
* Secret: `<database>.<your_schema>.integration_linkedin_ads_oauth` | ||
* External Access Integration: `integration_linkedin_ads` | ||
* start_date: UTC date in the format 2020-09-17. Any data before this date will not be replicated. | ||
* account_ids: Specify the account IDs separated by a space, to pull the data from. Leave empty, if you want to pull the data from all associated accounts. See the [LinkedIn Ads docs](https://www.linkedin.com/help/linkedin/answer/a424270/find-linkedin-ads-account-details) for more info. | ||
maxi297 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* Output Database: The database where the records will be saved. Snowflake's database naming restriction applies here. | ||
* Output Schema: The table where the schema will be saved. Snowflake's table naming restriction applies here. | ||
* Connection name: How the connection will be referred in the Streamlit app | ||
* Replication Frequency: How often do the records will be fetched | ||
maxi297 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Run a sync | ||
Once a connection is configured, go in `Connections List` and click on `Sync Now` for the connection you want to sync. Once the sync is complete, you should be able to validate that the records have been stored in `<your_database>.<your_schema>` | ||
|
||
### Supported Streams | ||
As of now, all supported streams perform a full refresh. Incremental syncs are not yet supported. Here are the list of supported streams: | ||
* Accounts | ||
* Account Users | ||
* Ad Analytics by Campaign | ||
* Ad Analytics by Creative | ||
* Campaigns | ||
* Campaign Groups | ||
* Creatives |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.