def create_ad_conversion_pixel(params={}): pixel = AdConversionPixel(parent_id=test_config.account_id) pixel[AdConversionPixel.Field.name] = unique_name('Conversion Pixel') pixel[AdConversionPixel.Field.tag] = 'checkout' pixel.update(params) pixel.remote_create() atexit.register(remote_delete, pixel) return pixel
# of this software is subject to the Facebook Developer Principles and # Policies [http://developers.facebook.com/policy/]. This copyright notice # shall be included in all copies or substantial portions of the software. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. from facebookads import test_config ad_account_id = test_config.account_id # !_DOC [pruno] # _DOC open [ADCONVERSIONPIXEL_CREATE] # _DOC vars [ad_account_id:s] from facebookads.objects import AdConversionPixel pixel = AdConversionPixel(parent_id=ad_account_id) pixel.update({ AdConversionPixel.Field.name: 'Conversion Pixel Name', AdConversionPixel.Field.tag: 'checkout', }) pixel.remote_create() # _DOC close [ADCONVERSIONPIXEL_CREATE] pixel.remote_delete()