本文整理匯總了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]