Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source-klaviyo: upgrade API version for campaigns and profiles to 2023-10-15 #2378

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Alex-Bair
Copy link
Member

@Alex-Bair Alex-Bair commented Feb 11, 2025

Description:

While most streams are using version 2023-10-15 of Klaviyo's API, campaigns and profiles are on earlier versions. This PR updates both streams to use API version 2023-10-15.

Changes from the updates are mainly to the location of certain properties in each stream's documents.

campaigns

The attributes.message property is now under the relationships.campaign-messages.data[0].id location.

profiles

The attributes.subscriptions.email.marketing.suppressions field is renamed to attributes.subscriptions.email.marketing.suppression (i.e. from plural to singular).

A note about campaigns. In API versions including 2023-10-15 and later, Klaviyo now has different types of campaigns. Previously, only email campaigns were returned from the /campaigns endpoint, but in version 2023-10-15 SMS campaigns can also be fetched at that endpoint. However, only a single type of campaign can be fetched in a single request-response cycle because Klaviyo only accepts a single campaign type in the request's query params. While it's possible to rewrite the campaigns stream to fetch these additional campaign types by using stream slices & updated state management techniques, doing so is a relatively large effort. Since our currently enabled captures have email campaigns & no SMS campaigns,
I'm punting on adding the functionality to fetch multiple types of campaigns in the campaigns stream to a later date.

Closes #2367.

Workflow steps:

(How does one use this feature, and how has it changed)

Documentation links affected:

(list any documentation links that you created, or existing ones that you've identified as needing updates, along with a brief description)

Notes for reviewers:

Tested on a local stack. Confirmed campaigns and profiles streams fetch records and complete. Confirmed the other incremental stream events is not affected by the updates to the IncrementalKlaviyoStream class.


This change is Reviewable

Unlike the 2023-02-22 API version, the 2023-10-15 API version of
`profiles` does not include a `subscriptions` field by default.
To have `subscriptions` included in `profiles` for the newer API version,
it needs to be included in the `additional-fields[profile]` query param.
In the previous 2023-06-15 API version, `campaigns` only returned email
campaigns. In API version 2023-10-15 and later, other types of campaigns
(like SMS) can be fetched at the same `/campaigns` endpoint. However,
it's not possible to fetch more than one type of campaign in a single
request-response cycle because only a single campaign type is accepted
as a query param.

While it's possible to rewrite the `campaigns` stream to fetch these
additional campaign types by using stream slices & updated state
management techniques, doing so is a relatively large effort. Since
our currently enabled captures have email campaigns & no SMS campaigns,
I'm punting on adding the functionality to fetch multiple types of
campaigns in the `campaigns` stream.
@Alex-Bair Alex-Bair marked this pull request as ready for review February 11, 2025 20:44
Copy link
Member

@williamhbaker williamhbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Alex-Bair
Copy link
Member Author

I'm holding off on merging until the schema changes are communicated & coordinated with existing users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

source-klaviyo: Upgrade revision version
2 participants