Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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]
Ejemplo n.º 4
0
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]