Custom GDPR Opt-in with Mailchimp

9379e0f68d34f1973b728c1b069135b2?s=106 Published on by Ruby, gdpr, and mailchimp

It seems like the whole world over is getting ready for GDPR to hit and with 10 days to go if you’re still under pressure here’s something that might help. I’ll warn you now that this post is Mailchimp specific, but that covers most of our clients and our own products.

We’ve had a few clients deciding to email their existing lists and gather consent to continue emailing them. We first checked out Mailchimps built-in support for this, which I was quite surprised to see only supported hosted forms and popups which none of our integrations use exclusively.

This left us with two options:

  1. Use Mailchimps GDPR form fields and on our API integrations and bespoke styled newsletter forms, integrate our own approach. I didn’t like this idea as it seemed rather complex for the client to create the correct segments.
  2. Ignore Mailchimps GDPR forms and come up with our own approach. This is the option we decided to pursue.

Our approach

What we came up with was rather straightforward, creating a Date WEB_GDPR merge tag that stores GDPR opt-in date and once our web forms are updated to reflect GDPR standards we can pass along the current date as the value for this field.

For existing subscribers on the list, we needed a way to set this field so we created a Sinatra microservice to handle this.

We create a new campaign and insert a link to*|EMAIL|* if clicked it will update the users WEB_GDPR merge tag value and redirect them to a configurable thank you page.

You can find a more comprehensive guide for the Sinatra app on Github or deploy to Heroku below.


Hope this is useful and if you need any further technical GDPR advise or integrations please get in touch with us.

Related Articles

A standalone websocket server written in Crystal. It’s easy to use and works with any server-side language that can use JSON Web Tokens. You can find the Bifröst server on Github and if you’re using Ruby we have a companion gem to help your server-side code talk to Bifröst.

This is another post coming out of working on one of our products, You often see articles teaching testing or TDD on an example topic, so I thought it was time to start writing about real world testing, with real code.

In a recent project I have been using UUIDs as the primary key type with Rails 5 and PostgreSQL. This can be useful if your objects IDs are publicly exposed and you want to disguise the fact that they are a sequence, or how early on in the sequence they might be ;-)