本文整理汇总了Python中facebookads.objects.AdAccount.get_ads_pixels方法的典型用法代码示例。如果您正苦于以下问题:Python AdAccount.get_ads_pixels方法的具体用法?Python AdAccount.get_ads_pixels怎么用?Python AdAccount.get_ads_pixels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类facebookads.objects.AdAccount
的用法示例。
在下文中一共展示了AdAccount.get_ads_pixels方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_ads_pixel
# 需要导入模块: from facebookads.objects import AdAccount [as 别名]
# 或者: from facebookads.objects.AdAccount import get_ads_pixels [as 别名]
def create_ads_pixel():
account = AdAccount(test_config.account_id)
pixel = account.get_ads_pixels([AdsPixel.Field.code])
if pixel is None:
pixel = AdsPixel(parent_id=test_config.account_id)
pixel[AdsPixel.Field.name] = unique_name('Test Pixel')
pixel.remote_create()
return pixel
示例2: AdsPixel
# 需要导入模块: from facebookads.objects import AdAccount [as 别名]
# 或者: from facebookads.objects.AdAccount import get_ads_pixels [as 别名]
from facebookads.objects import AdsPixel
pixel = AdsPixel(parent_id=ad_account_id)
pixel[AdsPixel.Field.name] = 'My new Pixel'
pixel.remote_create()
# _DOC close [ADSPIXEL_CREATE]
pixel_id = pixel.get_id()
# _DOC open [ADSPIXEL_READ_PIXEL_CODE]
# _DOC vars [ad_account_id:s]
from facebookads.objects import AdsPixel, AdAccount
account = AdAccount(ad_account_id)
account.get_ads_pixels(fields=[AdsPixel.Field.code])
# _DOC close [ADSPIXEL_READ_PIXEL_CODE]
destination_account_id = config.secondary_account_id
business_id = config.business_id
# _DOC open [ADSPIXEL_SHARE_ADACCOUNT]
# _DOC vars [business_id:s, destination_account_id:s, pixel_id]
from facebookads.objects import AdsPixel
pixel = AdsPixel(pixel_id)
response = pixel.share_pixel(business_id, destination_account_id)
print(response.body())
# _DOC close [ADSPIXEL_SHARE_ADACCOUNT]