Skip to content

added twitter tracking pixel #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions twitter_ads/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ def media_creatives(self, id=None, **kwargs):
"""
return self._load_resource(MediaCreative, id, **kwargs)

def pixel(self, id=None, **kwargs):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer a different name, but not sure what that should be

"""
Returns a collection of pixels (web_event_tags) available to the current account.
"""
return self._load_resource(Pixel, id, **kwargs)

def scoped_timeline(self, *id, **kwargs):
"""
Returns the most recent promotable Tweets created by the specified Twitter user.
Expand Down
25 changes: 25 additions & 0 deletions twitter_ads/pixel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from twitter_ads.enum import TRANSFORM
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TRANSFORM isn't used here

from twitter_ads.resource import resource_property, Resource, Persistence, Batch, Analytics
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Batch and Analytics aren't used here

from twitter_ads.http import Request
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request isn't used here

from twitter_ads.cursor import Cursor

class Pixel(Resource, Persistence):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer a different name, but not sure what that should be


PROPERTIES = {}

RESOURCE_COLLECTION = '/1/accounts/{account_id}/web_event_tags'
RESOURCE = '/1/accounts/{account_id}/web_event_tags/{id}'

# read only
resource_property(Pixel, 'embed_code', readonly=True)
resource_property(Pixel, 'id', readonly=True)
resource_property(Pixel, 'status', readonly=True)
resource_property(Pixel, 'website_tag_id', readonly=True)

#writeable
resource_property(Pixel, 'account_id')
resource_property(Pixel, 'name')
resource_property(Pixel, 'click_window')
resource_property(Pixel, 'view_through_window')
resource_property(Pixel, 'type')
resource_property(Pixel, 'retargeting_enabled')