Created
June 27, 2012 20:02
-
-
Save kjiwa/3006499 to your computer and use it in GitHub Desktop.
Show pageviews for all Optify leads in the last 24 hours
This file contains 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
GetVisitorsParameters params = new GetVisitorsParameters(siteToken); | |
int offset = 0; | |
while (true) { | |
Visitor[] visitors = service.getVisitors(params); | |
if (visitors.length == 0) | |
break; | |
for (Visitor visitor : visitors) { | |
if (!visitor.isLead()) | |
continue; | |
Visit[] visits = visitor.getVisits(); | |
for (Visit visit : visits) { | |
PageView[] pageViews = visit.getPageViews(); | |
for (PageView pageView : pageViews) { | |
System.out.println("URL: " + pageView.getUrl() + "\nTitle: " + pageView.getPageTitle()); | |
} | |
} | |
} | |
offset += visitors.length; | |
params.setOffset(offset); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment