Title: | Load Data from 'Linkedin Advertising API' |
Version: | 0.2.0 |
Description: | Get data from 'Linkedin Advertising API' https://learn.microsoft.com/en-us/linkedin/marketing/overview?view=li-lms-2023-10. You can load ad account hierarchy (accounts, users, campaign groups, campaigns and creatives) and also you can load ad analytics data from your 'Linkedin' Ad account. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
RoxygenNote: | 7.2.3 |
Imports: | cli, dplyr, httr2 (≥ 1.0.0), pbapply, rappdirs, rlang, snakecase, stringr, tidyr, urltools, utils |
NeedsCompilation: | no |
Packaged: | 2024-01-29 11:09:19 UTC; SAMSUNG |
Author: | Alexey Seleznev |
Maintainer: | Alexey Seleznev <selesnow@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2024-01-29 13:30:04 UTC |
rlinkedinads: Load Data from 'Linkedin Advertising API'
Description
Get data from 'Linkedin Advertising API' https://learn.microsoft.com/en-us/linkedin/marketing/overview?view=li-lms-2023-10. You can load ad account hierarchy (accounts, users, campaign groups, campaigns and creatives) and also you can load ad analytics data from your 'Linkedin' Ad account.
Author(s)
Maintainer: Alexey Seleznev selesnow@gmail.com (ORCID)
Authorization in Linkedin API
Description
Authorization in Linkedin API. For more details see link.
Usage
lkd_auth(login = Sys.getenv("LKD_LOGIN"))
Arguments
login |
your Linkedin login |
Value
No return value, just take API token
Examples
## Not run:
# set auth data
lkd_set_client_id('Your client id')
lkd_set_client_secret('Your client secret')
lkd_set_login('Your linkedin login')
lkd_auth()
## End(Not run)
Get account list
Description
Get account list
Usage
lkd_get_accounts(start = 0, count = 1000)
Arguments
start |
Integer, paggination. The index of the first item you want results for. |
count |
Integer, pagination. The number of items you want included on each page of results. There could be fewer items remaining than the value you specify. |
Value
tibble with account metadata
Find Ad Accounts by Authenticated User All ad accounts that an authenticated user has access
Description
Find Ad Accounts by Authenticated User All ad accounts that an authenticated user has access
Usage
lkd_get_accounts_by_authenticated_user(start = 0, count = 1000)
Arguments
start |
Integer, paggination. The index of the first item you want results for. |
count |
Integer, pagination. The number of items you want included on each page of results. There could be fewer items remaining than the value you specify. |
Value
tibble with accounts list
Find Ad Account Users by Accounts Fetch all users associated with a specific ad account. See next link.
Description
Find Ad Account Users by Accounts Fetch all users associated with a specific ad account. See next link.
Usage
lkd_get_ad_account_users_by_accounts(account_urn_id, start = 0, count = 1000)
Arguments
account_urn_id |
accounts ID with a sponsoredAccount URN |
start |
Integer, paggination. The index of the first item you want results for. |
count |
Integer, pagination. The number of items you want included on each page of results. There could be fewer items remaining than the value you specify. |
Value
tibble with users list
Get Linkedin ads analytics The Analytics Finder should be used when specifying a single pivot.
Description
Get Linkedin ads analytics The Analytics Finder should be used when specifying a single pivot.
Usage
lkd_get_ads_analytics(
pivot = c("COMPANY", "ACCOUNT", "SHARE", "CAMPAIGN", "CREATIVE", "CAMPAIGN_GROUP",
"CONVERSION", "CONVERSATION_NODE", "CONVERSATION_NODE_OPTION_INDEX",
"SERVING_LOCATION", "CARD_INDEX", "MEMBER_COMPANY_SIZE", "MEMBER_INDUSTRY",
"MEMBER_SENIORITY", "MEMBER_JOB_TITLE", "MEMBER_JOB_FUNCTION", "MEMBER_COUNTRY_V2",
"MEMBER_REGION_V2", "MEMBER_COMPANY"),
fields = c("pivotValues", "dateRange", "clicks", "impressions", "dateRange",
"costInUsd", "oneClickLeads", "externalWebsiteConversions"),
date_from = Sys.Date() - 31,
date_to = Sys.Date() - 1,
time_granularity = c("DAILY", "ALL", "MONTHLY", "YEARLY"),
campaign_type = NULL,
sort_by_fields = c("", "COST_IN_LOCAL_CURRENCY", "IMPRESSIONS", "ONE_CLICK_LEADS",
"OPENS", "SENDS", "EXTERNAL_WEBSITE_CONVERSIONS"),
sort_by_order = c("", "ASCENDING", "DESCENDING"),
...
)
Arguments
pivot |
String. Pivot of results, by which each report data point is grouped.
|
fields |
String vector of report metrics. You can find list of actual metrics here. |
date_from |
Date. Represents the inclusive start time range of the analytics. If unset, it indicates an open range up to the end time. |
date_to |
Date. Represents the inclusive end time range of the analytics. Must be after start time if it's present. If unset, it indicates an open range from start time to everything after. |
time_granularity |
String. Time granularity of results. Valid enum values:
|
campaign_type |
String. Match result by a campaign type. Supported types are: TEXT_AD, SPONSORED_UPDATES, SPONSORED_INMAILS, DYNAMIC. Requires at least one other facet. Defaults to empty. |
sort_by_fields |
String. The field by which the results are sorted. Supported values include:
|
sort_by_order |
String. The order of the results. Supported values include:
|
... |
Faceting parameter For more details see next link.You must specify at least one of:
|
Value
tibble with report
Examples
## Not run:
stat <- lkd_get_ads_analytics(
pivot = 'CAMPAIGN',
date_from = '2023-09-01',
date_to = '2023-09-30',
time_granularity = 'DAILY',
fields = c(
'pivotValues',
'dateRange',
'clicks',
'impressions',
'dateRange',
'costInUsd',
'oneClickLeads',
'externalWebsiteConversions'
),
accounts = 'urn:li:sponsoredAccount:511009658',
campaigns = c(
'urn:li:sponsoredCampaign:253102116',
'urn:li:sponsoredCampaign:276103383'
)
)
## End(Not run)
Get Ad campaign Groups Campaign groups provide advertisers a way to manage status, budget, and performance across multiple related campaigns.
Description
Get Ad campaign Groups Campaign groups provide advertisers a way to manage status, budget, and performance across multiple related campaigns.
Usage
lkd_get_campaign_groups(
account_id = lkd_get_account_id(),
test = FALSE,
start = 0,
count = 1000
)
Arguments
account_id |
your Linkedin Ad Account ID |
test |
Searches for campaigns based on test or non-test status:
|
start |
Integer, paggination. The index of the first item you want results for. |
count |
Integer, pagination. The number of items you want included on each page of results. There could be fewer items remaining than the value you specify. |
Value
tibble with campaign groups metadata
Get campaigns
Description
Get campaigns
Usage
lkd_get_campaigns(
account_id = lkd_get_account_id(),
test = FALSE,
start = 0,
count = 1000
)
Arguments
account_id |
your Linkedin Ad Account ID |
test |
Searches for campaigns based on test or non-test status:
|
start |
Integer, paggination. The index of the first item you want results for. |
count |
Integer, pagination. The number of items you want included on each page of results. There could be fewer items remaining than the value you specify. |
Value
tibble with campaign metadata
Get Creatives You can search for creative content in order to get a collection of creatives matching
Description
Get Creatives You can search for creative content in order to get a collection of creatives matching
Usage
lkd_get_creatives(account_id = lkd_get_account_id(), start = 0, count = 1000)
Arguments
account_id |
your Linkedin Ad Account ID |
start |
Integer, paggination. The index of the first item you want results for. |
count |
Integer, pagination. The number of items you want included on each page of results. There could be fewer items remaining than the value you specify. |
Value
tibble with creatives metadata
remove token
Description
remove token
Usage
lkd_remove_token(login = lkd_get_login())
Arguments
login |
your login at Linkedin |
Value
no return value, just remove token cacche
Set Ad Account ID for R session
Description
Set Ad Account ID for R session
Usage
lkd_set_account_id(account_id)
Arguments
account_id |
Id of your ad account |
Value
no return value
Set Linkedin API version For dwtwils se next link
Description
Set Linkedin API version For dwtwils se next link
Usage
lkd_set_api_version(api_version)
Arguments
api_version |
Linkedin API version |
Value
no return value
Set App Client ID For more information see this links.
Description
Set App Client ID For more information see this links.
Usage
lkd_set_client_id(client_id)
Arguments
client_id |
you linkedin APP ID |
Value
no return value
Set App Client secret For more information see this links.
Description
Set App Client secret For more information see this links.
Usage
lkd_set_client_secret(client_secret)
Arguments
client_secret |
Your APP secret |
Value
no return value
Set login for current R session
Description
Set login for current R session
Usage
lkd_set_login(login)
Arguments
login |
Your Linkedin login |
Value
no return value
Set own token cache path
Description
Set own token cache path
Usage
lkd_set_token_path(token_path)
Arguments
token_path |
Path to cache folder |
Value
no return value