WordPress plugin that integrates Zoom and Kit
-
Add zoom_kit_integration.php and the zoom_kit_integration/includes folder plus contents to wp-contents/plugins.
-
Add the following constants to wp-config.php:
define('WP_DEBUG', false); // Change value to true to write debugging info to the log when write_to_log() is called
define( 'ZKI_KIT_KEY', ' ' ); // Your Kit API key
define( 'ZKI_ZOOM_CLIENT', ' ' ); // Your Zoom API client key
define( 'ZKI_ZOOM_ACCOUNT', ' ' ); // Your Zoom API account key
define( 'ZKI_ERROR_REPORT_EMAIL', ' ' ); // Your email address to receive notifications of errors via wp_mail()
define( 'ZKI_HOST_NAME', ' ' ); // Host name of the WordPress site
The following are used when calling PHP core functions openssl_encrypt() and openssl_decrypt() in order to use encrypted Kit subscriber ID's in URL's in URL's used to tag Kit subscribers and write values to Kit custom fields.
define( 'ZKI_TOKEN_KEY', ' ' ); // Your own personal encryption passphrase
define( 'ZKI_TOKEN_METHOD', ' ' ); // The algorhythm used for the encryption
define( 'ZKI_TOKEN_IV', ' ' ); // Initialisation vector. NB *** this plugin does not support rotation of the IV value ***
-
On the WordPress admin Plugins page, Activate the plugin "Jo Clark's Kit and Zoom Plugin"
-
Set up the Kit and Zoom options on admin page Settings->zoom_kit_integration. These settings are stored in the WordPress wp-options table. Zoom Settings:
- ID of the webinar or meeting
- Choose whether webinar or meeting
Required Kit tags (can have any name):
- Attended live
- Watched replay
Required Kit custom fields (can have any name):
- Zoom join URL
- Total duration attended live in minutes
- Zoom live join/exit times
-
Register a Kit subscriber for a Zoom meeting or webinar then store the Zoom join URL in a Kit custom field for use in reminder emails. The Zoom meeting/webinar and the Kit custom field are as specified on the plugin's admin page settings. Call webhook from a Kit rule, triggered when a Kit subscriber requests registration for the meeting/webinar: https://ZKI_HOST_NAME/wp-json/zoom_kit_integration/v2/zar2w/
-
Post webinar/meeting processing. Download attendance data from Zoom, record each attending registrant in Kit. Process is split into 3 stages to avoid WordPress timeout when large numbers of attendees. Run from command line or Postman in the following order, wait for each to complete with status 200 before proceeding to next step. 2.1 Download Zoom webinar attendees (paginated, 300/page). https://ZKI_HOST_NAME/wp-json/zoom_kit_integration/v2/zpw/ 2.2 Tag each attendee in Kit with the "attended live" tag, as specified on the plugin's admin page settings. https://ZKI_HOST_NAME/wp-json/zoom_kit_integration/v2/zpw2taki/ 2.3 Record attendance duration/join-exit custom fields for each attendee in Kit https://ZKI_HOST_NAME/wp-json/zoom_kit_integration/v2/zpw2cfki/
-
This is necessary in advance, in order to use replay watcher functions (4 & 5 below). For each subscriber in Kit, encrypt their subscriber ID and store it in custom field "indiv_token". NB requires that this custom field has been created in Kit. Can be run via a Kit rule webhook action each time a new subcriber is created. Or from the command line or Postman in case of failure. Or for initial setup, by creating a temporary rule to call the webhook, then adding a temporary tag, which triggers the rule, to all subcribers. https://ZKI_HOST_NAME/wp-json/zoom_kit_integration/v2/4UJ8lH9EtZ0D/
-
Record webinar/meeting replay watchers in Kit by adding "watched replay" tag, as specified on the plugin's admin page settings. Call from javascript on the replay video webpage when desired length of video has been watched. Requires page URL to include the subscriber's encrypted Kit ID from their "indiv_token" custom field. e.g. https://ZKI_HOST_NAME/replay?indiv_token= async function doTag() { const token = new URLSearchParams(window.location.search).get("indiv_token"); await fetch ('https://ZKI_HOST_NAME/wp-json/zoom_kit_integration/v2/kit/'+token, {method: 'POST',}).catch(err => console.error(err)); }
-
Optionally additional tags may be applied to the Kit subscriber, to record the video time watched, e.g. "watched 5 minutes". Similar to function 4 but specify the tag to apply by its ID. e.g. async function do5Tag() { const token = new URLSearchParams(window.location.search).get("indiv_token"); await fetch ('https://ZKI_HOST_NAME/wp-json/zoom_kit_integration/v2/kittag/'+token, {method: 'POST', body: JSON.stringify({'tag' : 1234}), headers: {'Content-type': 'application/json'}}).catch(err => console.error(err)); }