Created
November 18, 2017 13:45
-
-
Save colemanja91/8dbebf8b51ffa8fe56df7c79ab57b5a8 to your computer and use it in GitHub Desktop.
Example showing Eloqua activity exports with PyEloqua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" export clickthrough data - example """ | |
from json import dump | |
from pyeloqua import Bulk | |
bulk = Bulk(username='xxx', password='xxx', company='xxx') | |
bulk.exports('activities', act_type='EmailClickthrough') | |
bulk.add_fields() # this will add all fields, or you can specify as listed in the documentation | |
# Field lists located here: https://github.com/colemanja91/pyeloqua/blob/master/pyeloqua/system_fields.py | |
bulk.filter_date('ActivityDate', start='2017-03-20 00:00:00', end='2017-03-21 00:00:00') | |
# Set a filter by activity type; no need to do this if using PyEloqua >= v0.5.5 | |
# bulk.filter_equal('ActivityType', 'EmailClickthrough') | |
bulk.create_def('my export') | |
bulk.sync() | |
activities = bulk.get_export_data() | |
# export the data to a flatfile | |
with open('email_click_export.json', 'w') as fopen: | |
dump(activities, fopen) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does bulk.exports have the ability to handle multiple activity types? Or they need to be passed separately? (I.E. - Email Clickthrough, Email Open, etc.)