Search code examples
google-apigoogle-calendar-apigoogle-reporting-api

Google Reports API for Meet attendance - strange conference_id


I'm trying to query attendance for a Google Meet conference created via Google Calendars API. I've found that the conferenceId returned by Calendar API > Events > insert it's different from the one I can use to filter in Reports API.

  1. conferenceId from Calendar API --> ["conferenceId"]=>string(12) "xxx-xxxx-xxx"
  2. conferenceId from Reports API{"name": "conference_id", "value": "xxxxxxx_12234XXXXXxxxxXX56"}

Does anyone knows why? How can I query attendance based on the data returned by Calendar API > Events > insert ?

Steps to reprocuduce:

  1. Insert calendar events (be sure to add conferenceData structure to create also the Meet conference): https://developers.google.com/calendar/api/v3/reference/events/insert

  2. Use the conference

  3. List activities from Report API and check the conference_id: https://developers.google.com/admin-sdk/reports/reference/rest/v1/activities/list


Solution

  • It seems that the conferenceId from the Calendar event object is different from the conference_id in the Reports (note that the name is different). The activities.list output also has another field called meeting_code, it's also under items.events.parameters:

    {
        "name": "meeting_code",
        "value": "ASDFASFFGJ"
    }
    

    This one matches the conferenceId in a calendar event, except that it's without dashes and capitalized, so for the example "conferenceId": "asd-fasf-fgj" in a Calendar Event object you'll find "meeting_code": "ASDFASFFGJ" in the activity reports. So you can just remove the dashes and capitalize the conferenceId to match it to its corresponding meeting_code.

    As to why this discrepancy exists, my guess after reading the definition of the Meet activity events is that it tracks different "conference sessions" within the same meeting code. For example, if you join the meeting asd-fasf-fgj it will create a new conference_id until everyone leaves the meeting. Then if the same meeting code is used again a different conference_id will be created to track the new session and so on.

    I did some cursory testing and the logs do create a different conference_id every time I joined the same Meeting code. I didn't have multiple accounts to test so I'm not sure if two users can have matching IDs, but I may be close. I couldn't find any in-depth documentation so it would require more testing to figure out exactly how it works.

    Either way, to address your immediate concern, you should be able to match the Event's conferenceId with the Report's meeting_code to track the attendance.

    Reference: