Custom export using getLastVisitsDetails and getVisitorProfile


The goal is to get all the users visitorId, totalPageViews and totalEcommerceRevenue fields for the current month.

I’m doing 2 subsequent queries. The first one is:

$url .= “?module=API&method=Live.getLastVisitsDetails”;
$url .= “&idSite=1&period=month&date=today”;
$url .= “&format=JSON&filter_limit=10”;
$url .= “&token_auth=$token_auth”;

and then, for each visitorId if this first query, I’m trying to get all data returned by the Live.getVisitorProfile method with the next query but I can’t.

$url2 .= “?module=API&method=Live.getVisitorProfile”;
$url2 .= “&idSite=1&period=month&date=today&expanded=1”;
$url2 .= “&format=JSON&visitorId=” . $row[‘visitorId’];
$url2 .= “&action=index&token_auth=$token_auth”;

I’m not getting the data I’m looking for from this method. I don’t know why.
And when I print_r the result, I get a bunch of weird numbers:


What am I doing wrong?

Looks like nobody knows :smiley: