This PR addresses several bugs from 4.1.0 release which added support for Klaviyo's V3 APIs.
Fixes issues with store-scoped requests. If you scope each store to a different Klaviyo account we will now correctly retrieve the correct private API key and sync the events.
Fixes response handling for Added to Cart requests - previously our APIs returned 0/1 for failure/success. Now we return json with more information about the errors (if applicable). This updates our handling to accept the new response schema and correctly marks successful rows as such.
Fixes logging to log out a much more useful error message on retries, adds handling for 401s
Updates Added to Cart observers to check for the private api key instead of the public key.
Fixes a bug w/ directly adding a profile to a list
Manual Testing Steps
Tested the following cases:
Default scoping, multiple sites: ensured all sites correctly fired ATC events using the default config.
Store-scoped, multiple sites, multiple Klaviyo accounts: ensured all sites correctly fired ATC events using the store-scoped config. Verified events appeared on correct Klaviyo account
Multiple sites, one using default, one using store-scoped config: ensured all sites correctly fired ATC events using the store-scoped config. Verified events appeared on correct Klaviyo account
Tested error handling cases (forced 401s, 403s) to validate RETRY was set as row status and that logs were emitted with the correct message.
Tested missing Private Key, validated no row was added to the kl_events table.
Pre-Submission Checklist:
[x] You've updated the CHANGELOG following the steps here
[x] Internal Only - If this is a release, please confirm the following:
[ ] The links in the changelog have been updated to point towards the new versions
[ ] The version has been incremented in the following places: module.xml and composer.json
NOTE: Please use the Changelogger cli tool to manage versioned file upgrades.
Description
This PR addresses several bugs from 4.1.0 release which added support for Klaviyo's V3 APIs.
Manual Testing Steps
Tested the following cases:
Tested error handling cases (forced 401s, 403s) to validate RETRY was set as row status and that logs were emitted with the correct message.
Tested missing Private Key, validated no row was added to the kl_events table.
Pre-Submission Checklist:
NOTE: Please use the Changelogger cli tool to manage versioned file upgrades.