planningcenter / developers

Planning Center API docs and support
https://developer.planning.center/docs/
85 stars 8 forks source link

Total Check-Ins #662

Closed eattrig closed 5 years ago

eattrig commented 5 years ago

Related Applications Which application(s) is this question related to? Check-Ins

Describe the question My task is to pull the same totals you display in the graph from the Event Check-Ins Admin area for Event Listings (i.e. https://check-ins.planningcenteronline.com/events) for a specific event, for all times (i.e. an entire weekend). I have figured out how to use your API to get the headcounts information (in our case, auditorium and overflow), but I can't seem to figure out an easy way to get the check-ins information. If I query for all check-ins, I can see a total count, but it doesn't match the count displayed in the Event Listings area I referenced above. I think this is because the same person is being checked in repeatedly, but your display in the Event Listings area detects these duplicates. Also, then I'll be actually downloading all check-in information for every attendee even though I just need the totals, which seems very inefficient. Of course, if that's the way it has to be done, I'll do it.

I have..

eattrig commented 5 years ago

I don't know whether anyone monitors this site, but I've learned some more information since I posted this question. For the most recent weekend at my church, focusing in on the Regular Check-Ins, I have 3 numbers that I expect to match but they don't. The number displayed in the graph in Event Listings (https://check-ins.planningcenteronline.com/events) is 378. The number included in this weekend's Event Periods JSON data from the API (https://api.planningcenteronline.com/check-ins/v2/events/1/event_periods, "regular_count") is 413, an increase of 35. The number computed from summing the numbers in this weekend's Event Times JSON data from the API (https://api.planningcenteronline.com/check-ins/v2/events/1/event_periods/1/event_times, "regular_count") is 423, an increase of another 10 for a total increase of 45.

Now I think my duplicates theory is no good since the totals and the sum of the pieces doesn't even add up.

sheck commented 5 years ago

Hi @eattrig, sorry for the delay in answering! We just wrapped up a few weeks of special projects, so we haven't been monitoring this as closely.

I think what's happening here is that we display unique people checked-in on the admin dashboard, but out API returns total, non-unique people in the total_[check in kind type]_count attributes. So (to be extra clear) if someone is checking in twice to an event, you would see +1 on the attendance chart, but +2 in the API attributes.

Unfortunately, I'm not sure if we expose this information (unique attendance) anywhere in our API :/ But, that's something we can look into for the future 👍

eattrig commented 5 years ago

Thank you @sheck. Can you possibly give me some insight into how I might go about determining uniqueness on my own? In other words, what does your algorithm do?

Also, in the example I provided above, why the increase of 10 going from the Event Periods to the Event Times?

sheck commented 5 years ago

@eattrig We determine uniqueness based on the amount of unique people checked into an event period or event time. Unfortunately I can't think of a performant way you could go about doing this. You would need to fetch all of the check-ins for an event period or event time, include the people in request, and do a unique count of people. We have token note of this request though, so it may be something we provide a better solution for in the future 👍

Regarding that specific example, it would be hard to determine without seeing your data. If you want to submit a support ticket (click the ? icon in the top right of the admin dashboard in Check-Ins), we can take a look and give you more info as to why that might be happening.