Mailchimp Custom Field/Merge Tags
-
I opened a support ticket with s2 member as I have the multi site pro version. It’s been a few days with no word back so I thought I’d try this support forum as well.
s2member isn’t sending my registration custom field to mailchimp. Or at least this is what my log files form s2member show.
I have my custom field as a radio button with UNIQUE ID of “MERGE9” (no quotes). Values are 1 and 2.
Within Mailchimp I have MERGE9 setup as a radio button as well with values 1 and 2.
I have my s2-hack.php as follows:
add_filter(‘ws_plugin__s2member_mailchimp_merge_array’, function ($custom_fields, $vars)
{
$args = &$vars[‘args’]; // stdClass object.
# print_r($args); // for a full list of all properties.$custom_fields = array_merge($custom_fields, array(
‘ROLE’ => $args->role,
‘LEVEL’ => $args->level,
‘CCAPS’ => $args->ccaps,
‘LOGIN’ => $args->login,
‘USER_ID’ => $args->user_id,
‘MERGE9’ => $args->MERGE9,// A Custom Registration/Profile Field in s2Member can be obtained like this.
// Note thatmy_custom_field_id
should be replaced with the Unique ID that you configured for a field in s2Member.
// ‘MY_CUSTOM_FIELD’ => get_user_field(‘my_custom_field_id’, $args->user_id),
));
return $custom_fields;// Note that custom fields (aka: merge tags) will NOT work unless & until they are created by
// a site owner working inside their MailChimp account. They must first add the custom fields
// so they can be filled by the s2Member filter seen here.// See: <https://kb.mailchimp.com/merge-tags/using/getting-started-with-merge-tags>
}, 10, 2);I’m sure i’m missing something super simple. I’ve disabled all plugins, I’ve turned off caching on the site and still it’s a no go. Note that all other fields in the s2-hack.php work (e.g. role, user_id, etc.) I appreciate if anyone has any thoughts or suggestions.
Thanks for taking the time.
See the mailchimp s2member log file below:
LOG ENTRY: Wed Nov 25th, 2015 @ precisely 12:51 am UTC
PHP v5.6.4 :: WordPress v4.3.1 :: s2Member v150925 :: s2Member Pro v150925
Memory 10.63 MB :: Real Memory 11.00 MB :: Peak Memory 10.80 MB :: Real Peak Memory 11.00 MB/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586
Array
(
[args] => stdClass Object
(
[role] => s2member_level2
[level] => 2
[ccaps] =>
[login] => testuser4
[pass] => ********
[email] => dave@*******.com
[fname] => test
[lname] => user4
[ip] => ***********
[opt_out] =>
[opt_in] => 1
[double_opt_in] => 1
[user] => WP_User Object
(
[data] => stdClass Object
(
[ID] => 62
[user_login] => testuser4
[user_pass] => *************
[user_nicename] => testuser4
[user_email] => dave@************.com
[user_url] =>
[user_registered] => 2015-11-25 00:51:19
[user_activation_key] =>
[user_status] => 0
[display_name] => test user4
)[ID] => 62
[caps] => Array
(
[s2member_level2] => 1
)[cap_key] => wp_yuwzaw_capabilities
[roles] => Array
(
[0] => s2member_level2
)[allcaps] => Array
(
[read] => 1
[level_0] => 1
[access_s2member_level0] => 1
[access_s2member_level1] => 1
[access_s2member_level2] => 1
[spectate] => 1
[participate] => 1
[read_private_forums] => 1
[publish_topics] => 1
[edit_topics] => 1
[publish_replies] => 1
[edit_replies] => 1
[assign_topic_tags] => 1
[s2member_level2] => 1
)[filter] =>
)[user_id] => 62
[name] => test user4
)[function] => subscribe
[list] => 88a7*****
[list_id] => 88a7*****
[api_method] => listSubscribe
[api_properties] => Mailchimp Object
(
[apikey] => 39fa1f1b0a1c8bb65bb91c3db6a27d38-us9
[ch] => Resource id #389
[root] => https://us9.api.mailchimp.com/2.0/
[debug] =>
[folders] => Mailchimp_Folders Object
(
[master] => Mailchimp Object
*RECURSION*
)[templates] => Mailchimp_Templates Object
(
[master] => Mailchimp Object
*RECURSION*
)[users] => Mailchimp_Users Object
(
[master] => Mailchimp Object
*RECURSION*
)[helper] => Mailchimp_Helper Object
(
[master] => Mailchimp Object
*RECURSION*
)[mobile] => Mailchimp_Mobile Object
(
[master] => Mailchimp Object
*RECURSION*
)[conversations] => Mailchimp_Conversations Object
(
[master] => Mailchimp Object
*RECURSION*
)[ecomm] => Mailchimp_Ecomm Object
(
[master] => Mailchimp Object
*RECURSION*
)[neapolitan] => Mailchimp_Neapolitan Object
(
[master] => Mailchimp Object
*RECURSION*
)[lists] => Mailchimp_Lists Object
(
[master] => Mailchimp Object
*RECURSION*
)[campaigns] => Mailchimp_Campaigns Object
(
[master] => Mailchimp Object
*RECURSION*
)[vip] => Mailchimp_Vip Object
(
[master] => Mailchimp Object
*RECURSION*
)[reports] => Mailchimp_Reports Object
(
[master] => Mailchimp Object
*RECURSION*
)[gallery] => Mailchimp_Gallery Object
(
[master] => Mailchimp Object
*RECURSION*
)[goal] => Mailchimp_Goal Object
(
[master] => Mailchimp Object
*RECURSION*
))
[merge_array] => Array
(
[MERGE1] => test
[MERGE2] => user4
[OPTIN_IP] => 69.132.2.24
[OPTIN_TIME] => 2015-11-25 00:51:19
)[api_merge_array] => Array
(
[MERGE1] => test
[MERGE2] => user4
[OPTIN_IP] => 69.132.2.24
[OPTIN_TIME] => 2015-11-25 00:51:19
[ROLE] => s2member_level2
[LEVEL] => 2
[CCAPS] =>
[LOGIN] => testuser4
[USER_ID] => 62
[MERGE9] =>
)[api_email_type] => html
[api_double_optin] =>
[api_update_existing] => 1
[api_replace_interests] => 1
[api_send_welcome] =>
[api_response] => Array
(
[email] => dave@*******.com
[euid] => f4adc9b579
[leid] => 312476269
)[api_success] => 1
)
- The topic ‘Mailchimp Custom Field/Merge Tags’ is closed to new replies.