How To Send Leaky Paywall Data to Mailchimp List Fields
When a subscriber registers through Leaky Paywall, you have the opportunity to send data as List Fields to Mailchimp.
These are custom list fields that you set up in your Mailchimp account. You can use the data to create segments within your Mailchimp list.
1. Go to mailchimp.com and sign in to your account.
2. Go to the List you want to add merge fields to.
3. Click on Settings > List fields and *|MERGE|* tags
4. Click "Add a field" and create the fields you want to send to Mailchimp. Make sure you uncheck the "visible" setting for each field.
5. For our example, we are going to create fields for LP_LEVEL, LP_SUBDATE, and LP_EXPIRES. You can add as many fields as you like.
6. Using the leaky_paywall_mailchimp_merge_fields filter, we can send our subscriber's data to Mailchimp during the registration process. For each field you want to send, add it to the $merge_fields array, where the key is the merge tag you set in Mailchimp.
How to send Leaky Paywall Custom Registration Fields to Mailchimp Merge Tags
1. Add a custom field to your registration form using our Custom Registration Fields add-on.
2. Go to your registration form and inspect the form field. Copy the "name" attribute.
3. In the leaky_paywall_mailchimp_merge_fields filter from the code example above, you can access the field value using the $_POST super global and the name attribute from the form field.