In this simple Easy Digital Downloads / Convertkit integration, we’ll be subscribing users to Convertkit tags based on what downloads the customer purchases.
Convertkit Setup
In this integration, we’ll be hardcoding the tag IDs that we want to pass to the Convertkit API.
- Copy your API key from the Convertkit account page.
- Next, if you haven’t setup the tags you want to subscribe users to yet, do that by going to Subscribers > Create a Tag in the sidebar.
- Copy the tag IDs of the tags you’re going to use by clicking on the tag link and noting the numerical ID in the URL bar.
Easy Digital Downloads Setup
We’re also going to hardcode the download IDs that we want to tie to a Convertkit tag. In our example, the EDD download with an ID of 321 will be mapped to the Convertkit tag with an ID 4879234 and so on.
To get the download IDs you want to use, just go to Downloads in your WordPress admin and hover over the Downloads you want to use.
The Completed Code
Make sure to update the following items
- Change the CK_API_KEY constant to your Convertkit API key
- Map the correct EDD Download ID to the Convertkit tag ID
- Place the code in your functions.php or create a functionality plugin.
There are a ton of ways to modify this basic integration to fit your specific needs. Here are a few ideas.
Subscribe customers to one Convertkit tag
Create a “customer” tag in Convertkit, and just send all customers from EDD to that tag.
Use EDD Download name as Convertkit tag
A more advanced integration would be to use a purchased EDD Download name as a Convertkit tag. In other words, a customer purchasing [Download Name ABC] would be subscribed to the Convertkit tag [Download Name ABC]. I won’t provide code for this option, but the basics would be to:
- Loop through each download ID in the purchase like in the first example
- Grab all Convertkit tags using the tags endpoint (GET)
- If a given Download name matches one of the Convertkit tags, subscribe the user to that tag ID
- If a given Download name doesn’t match the existing Convertkit tags, create the tag programmatically using the tags endpoint (POST)
- Finally, subscribe the user to the newly created Convertkit tag after receiving the new tag ID in the previous response
Hopefully this give you some ideas on how to integrate Easy Digital Downloads data with Convertkit, and just how easy it is to do.