LinkedIn API中的目标受众计数 [英] Target Audience Count in LinkedIn API

查看:53
本文介绍了LinkedIn API中的目标受众计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

LinkedIn API v1具有一个api端点,用于计算所选目标受众的数量.更高版本的api仅针对Ads-API

LinkedIn API v1 had an api endpoint to count the number of selected target audience. The later apis has this endpoint only for Ads-API

现在,我正在尝试使用定位条件(

Now, I am trying to share posts using targeting criteria (Share API). I want to restrict posting if size of audience is less than 300. (As LinkedIn has a limit (audience size must be at least 300), I have to do a check first.) how do I count the size of target? (Note that, I have the count of individual categories with this endpoint: but these audiences might have intersection, so the sum of these counts aren't accurate.)

如果没有此功能,其他人将如何使用目标api?还是我错过了什么?

How does others use targeting api without this? Or am I missing something?

推荐答案

您可以使用 targetingCriteria 作为列表,例如:

You can use the Audience Counts API, where you can pass the targetingCriteria as a list, as example:

curl \
   -H "Authorization:Bearer <the_token>" \
   -H "Content-Type:application/json" \
   -H "X-Restli-Protocol-Version: 2.0.0" \
   "https://api.linkedin.com/v2/audienceCountsV2?q=targetingCriteriaV2&targetingCriteria=(include:(and:List((or:(urn%3Ali%3AadTargetingFacet%3AinterfaceLocales:List(urn%3Ali%3Alocale%3Aen_US))),(or:(urn%3Ali%3AadTargetingFacet%3Alocations:List(urn%3Ali%3Aregion%3A5636))))))"

将返回类似:

{
  "elements": [
    {
      "total": 1100000,
      "active": 0
    }
  ],
  "paging": {
    "count": 10,
    "start": 0,
    "links": []
  }
}

还要注意文档中描述的正确编码.

Take care of the correct encoding as described in the doc also.

更新

为了计算companyPage上的自然职位,您应该添加遵循的公司标准,如

In order to calculate organic post on a companyPage, you should add the followedCompanies criteria, as described in the doc here:

您要分享的目标受众必须大于300成员.使用AudienceCountsV2 API计算近似值您的受众群体的规模.确保在followedCompanies 字段的定位方面参数,因此您的受众数量将被过滤到仅关注您的成员公司.

The audience you target for your share must be greater than 300 members. Use the audienceCountsV2 API to calculate the approximate size of your audience. Make sure to pass in your company URN in the followedCompanies field of the targetingFacet parameter so your audience count will be filtered down to only members who follow your company.

因此,请参考前面的示例,以定位ID = 123的companyPage:

So referring to the previous example, for targeting a companyPage of ID = 123:

curl \
   -H "Authorization:Bearer token" \
   -H "Content-Type:application/json" \
   -H "X-Restli-Protocol-Version: 2.0.0" \
   "https://api.linkedin.com/v2/audienceCountsV2?q=targetingCriteriaV2&targetingCriteria=(include:(and:List((or:(urn%3Ali%3AadTargetingFacet%3AfollowedCompanies:List(urn%3Ali%3Aorganization%3A123))),(or:(urn%3Ali%3AadTargetingFacet%3AinterfaceLocales:List(urn%3Ali%3Alocale%3Aen_US))),(or:(urn%3Ali%3AadTargetingFacet%3Alocations:List(urn%3Ali%3Aregion%3A5636))))))"

希望对您有帮助

这篇关于LinkedIn API中的目标受众计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆