Created
June 11, 2021 16:07
-
-
Save DazWilkin/cb3dc429d2ba410ac500a9b28f3af5ff to your computer and use it in GitHub Desktop.
Stackoverflow #67888711
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
fields = ["campaign.id", "segments.device"] | |
query = """ | |
SELECT {fields} | |
FROM campaign | |
WHERE segments.date = '{date}' | |
LIMIT 10 | |
""".format( | |
fields=",".join([str(f) for f in fields]), | |
date="210611", | |
) | |
response = ga_service.search_stream( | |
customer_id=customer_id, | |
query=query, | |
) | |
for batch in response: | |
for row in batch.results: | |
for field in fields_list: | |
print("{field}: {value}".format( | |
field=field, | |
value=row[field], | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment