Plugin Contributor
Tracy Levesque
(@liljimmi)
🏳️🌈 YIKES, Inc. Co-Owner
Hello.
We do have some dynamic tags you can use in a field to grab data from the page:
Page Title
Page ID
Page URL
Blog Name
User Logged In
However, none of those are connected to a MailChimp interest group.
I will see if anyone has an idea of how one of those values could connect to an interest group field and check it.
Thank you!
-Tracy
Hi @bluesoul81,
Just want you to know I am looking into this; I hope to have some type of solution by tomorrow.
Kevin.
Hi @bluesoul81,
First, is there some attribute on a page that defines what interest group it is related to? We need to find a way to map the current page to the interest group. Once we have that, we can add a filter (and I can help you with that if you need).
For example, in my environment I added a hook that adds every subscriber of a certain form to a checkbox interest group. The add_filter line looks like:
add_filter( 'yikes-mailchimp-before-submission-2', 'mc_test_add_subcribers_to_interest_group', 10, 1 );.
Every time my form (with an ID of 2) is submitted, I call the mc_test_add_subcribers_to_interest_group function. This function looks like this:
function mc_test_add_subcribers_to_interest_group( $form_data ) {
// Add all subscribers to interest group 679, subgroup 1
$form_data['groupings'] = array(
array(
'id' => 679,
'groups' => array(
'Group 1'
)
)
);
return $form_data;
}
(Note that this function is hardcoded, and would need to be more robust for your purposes).
Hope that helps, let me know if you have questions,
Kevin.