jmf
jmf

Reputation: 396

How to get all the campaigns in Ad Analytics in Linkedin Ads API

I am new to working with APIs and especially with Linkedin API. I want to get Ad Reporting data. I only know to get a specific campaign data. How do I get all the campaign running for the account id?

Here is what I have run.

https://api.linkedin.com/v2/adAnalyticsV2?q=analytics&pivot=CREATIVE&dateRange.start.day=27&dateRange.start.month=1&dateRange.start.year=2019&timeGranularity=DAILY&campaigns[0]=urn:li:sponsoredCampaign:123456

I tried something like following and it didn't work.

https://api.linkedin.com/v2/adAnalyticsV2?q=analytics&pivot=CREATIVE&dateRange.start.day=27&dateRange.start.month=1&dateRange.start.year=2019&timeGranularity=DAILY&account=123456

Upvotes: 2

Views: 6247

Answers (1)

Have you tried this recommendation? I think it's what you're looking for.

https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads/account-structure/create-and-manage-campaigns#search-for-campaigns

Search for Campaigns

You can search for campaigns by ID, account, campaign group, name, type, and status fields. Search criteria can be chained together for increased granularity. If a search query is omitted, the API returns all the campaigns that the caller has access to.

GET https://api.linkedin.com/v2/adCampaignsV2?q=search&search.{searchCriteria}.values[0]={searchValue}

Upvotes: 1

Related Questions