Skip to content

Instantly share code, notes, and snippets.

@kjiwa
Created June 27, 2012 20:02
Show Gist options
  • Save kjiwa/3006499 to your computer and use it in GitHub Desktop.
Save kjiwa/3006499 to your computer and use it in GitHub Desktop.
Show pageviews for all Optify leads in the last 24 hours
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