cancel
Showing results for 
Search instead for 
Did you mean: 

How to test opens for more than 50 users.

Highlighted
Occasional Advisor

How to test opens for more than 50 users.

Hi, i was developing report. And to fetch campaign open m using this function.

/**
* Get open events for a Campaign
* @param Campaign $Campaign
* @param string $page - optional 'nextLink' from previous getContactOpens call
* @return array - Up to 50 CampaignEvents and a link to the next page if one exists
*/
public function getCampaignOpens(Campaign $Campaign, $page=null){
$CampaignsCollection = new CampaignsCollection($this->CTCTRequest);
$url = ($page) ? $this->CTCTRequest->baseUri.$page : $this->CTCTRequest->baseUri.$Campaign->link.'/events/opens';
return $CampaignsCollection->getCampaignEvents($url, 'OpenEvent');
}

 

So if i don't have more than 50 users for testing then I will not get the 2nd paramter of function. So how can I test this section. please suggest.

And why you people use link in 2nk paramter. There must be simple calculation like just pass 50 in 2nd paramter and it will skip 50 users. If we pass 100 there it will skip 100 users and fetch later units. How we can use this please suggest.

2 REPLIES 2
CTCT Employee

Re: How to test opens for more than 50 users.

Hi,

 

The Opens tag currently shows the number for ALL opens for an email campaign as long as you have email tracking on, as opposed to "unique" opens, which would be the opens for each email address.  With it set up the way it is, you can send out an email to one email address, open the email 50 separate times, and test that way.  Just be sure you're opening the live email, not just the email confirming that you sent an email.

 

Sorry we have no way to simulate opens besides actually opening the email.  We do the next links to limit the amount of data that needs to be sent in each request.  The server could time out otherwise.

 

Best Regards,

Shannon W.

API Support Specialist

Moderator

Re: How to test opens for more than 50 users.

Great feedback on the way we handle pagination.  This is a relic of some older technology we used for managing our tracking data and how pagination work with our database.  We are changing that in our next version of the API to use a limit and offset format that you're probably familiar with from other API platforms.  Limit would be the max results we'd return to a request and offset would be how many to skip.  For example, a limit of 100 and offset of 1 would provide the first 100 items. 

Dave Berard
Senior Product Manager, Constant Contact