Skip to content
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

Incomplete API for Event and Site Tracking #1

Open
kevinpostal opened this issue Jan 27, 2015 · 1 comment
Open

Incomplete API for Event and Site Tracking #1

kevinpostal opened this issue Jan 27, 2015 · 1 comment

Comments

@kevinpostal
Copy link

I'm not seeing anything in the Python API that allows for Site and Event Tracking.

http://www.activecampaign.com/api/example.php?call=track_event_add

@qjflores
Copy link

You can create your own Event.py with a class like this

`class Event(ActiveCampaign):

def __init__(self, url, api_key):
    self.url = url
    self.track_url = 'https://trackcmp.net/event?'
    self.api_key = api_key
    ActiveCampaign.__init__(self, url, api_key)

def add(self, params, post_data):
    request_url = '%s&api_key=%s&api_action=track_event_add&api_output=%s' % (self.track_url, self.api_key, self.output)
    post_data = urllib.urlencode(post_data)
    req = urllib2.Request(request_url, post_data)
    response = json.loads(urllib2.urlopen(req).read())
    return response`

then run

ac = ActiveCampaign(ACTIVECAMPAIGN_URL, ACTIVECAMPAIGN_API_KEY) ac.api('event/add', post_data)

http://www.activecampaign.com/api/example.php?call=track_event_add

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants