lkd_get_ads_analytics {rlinkedinads}R Documentation

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.

  • COMPANY - Group results by advertiser's company

  • ACCOUNT - Group results by account.

  • SHARE - Group results by sponsored share.

  • CAMPAIGN - Group results by campaign.

  • CREATIVE - Group results by creative.

  • CAMPAIGN_GROUP - Group results by campaign group.

  • CONVERSION - Group results by conversion.

  • CONVERSATION_NODE - The element row in the conversation will be the information for each individual node of the conversation tree.

  • CONVERSATION_NODE_OPTION_INDEX - Used actionClicks are deaggregated and reported at the Node Button level. The second value of the pivot_values will be the index of the button in the node.

  • SERVING_LOCATION - Group results by serving location, onsite or offsite.

  • CARD_INDEX - Group results by the index of where a card appears in a carousel ad creative. Metrics are based on the index of the card at the time when the user's action (impression, click, etc.) happened on the creative (Carousel creatives only).

  • MEMBER_COMPANY_SIZE - Group results by member company size.

  • MEMBER_INDUSTRY - Group results by member industry.

  • MEMBER_SENIORITY - Group results by member seniority.

  • MEMBER_JOB_TITLE - Group results by member job title.

  • MEMBER_JOB_FUNCTION - Group results by member job function.

  • MEMBER_COUNTRY_V2 - Group results by member country.

  • MEMBER_REGION_V2 - Group results by member region.

  • MEMBER_COMPANY - Group results by member company.

  • PLACEMENT_NAME - Group results by placement.

  • IMPRESSION_DEVICE_TYPE - Group results by the device type the ad made an impression on. Reach metrics and conversion metrics will not be available when this pivot is used.

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:

  • ALL - Results grouped into a single result across the entire time range of the report.

  • DAILY - Results grouped by day.

  • MONTHLY - Results grouped by month.

  • YEARLY - Results grouped by year.

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:

  • COST_IN_LOCAL_CURRENCY

  • IMPRESSIONS

  • CLICKS

  • ONE_CLICK_LEADS

  • OPENS

  • SENDS

  • EXTERNAL_WEBSITE_CONVERSIONS

sort_by_order

String. The order of the results. Supported values include:

  • ASCENDING

  • DESCENDING

...

Faceting parameter For more details see next link.You must specify at least one of:

  • shares - Match result by share facets. Defaults to empty.

  • campaigns - Match result by campaign facets. Defaults to empty. For example campaigns = c('urn:li:sponsoredCampaign:253102116', 'urn:li:sponsoredCampaign:276103383').

  • creatives - Match result by creative facets. Defaults to empty.

  • campaignGroups - Match result by campaign group facets. Defaults to empty.

  • accounts - Match result by sponsored ad account facets. Defaults to empty. For example accounts = 'urn:li:sponsoredAccount:511009658'.

  • companies - Match result by company facets. Defaults to empty.

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)

[Package rlinkedinads version 0.2.0 Index]