• Resolved Frank S

    (@frankswebsites)


    Hi, can you please clarify how to add a subscriber to a segment or group when subscribing to a list? I have set up a from and connected to the account with the API key, created segments in that list, but cannot figure out how to set it up in Easy Mailchimp Forms.

    To be specific:
    For a client, we are looking to offer multiple downloads to visitors. To be able to get to the download, the visitor has to fill inn their email address and get subscribed to our list in Mailchimp. Within the list, we would like to see and segment the list based on which download or downloads the person has acquired.

    Thanks & regards,
    – Frank

    https://www.ads-software.com/plugins/yikes-inc-easy-mailchimp-extender/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Evan Herman

    (@eherman24)

    Hi there Frank,

    To add users to a specific interest group, you’ll want to set up the interest groups over on MailChimp.com. If you need help you can follow along with the video found here.

    Once you have your interest groups set up on the chosen form, you can update the specified form within the plugin by going to ‘MailChimp Forms > Manage List Forms’ and click the ‘Re-Import Form Fields from MailChimp’ button below the form.

    You should then receive a notification that the form has successfully been updating.

    Once you have updated the form, on the front end of your site you should then see all of your setup interest groups directly below the form, just before the ‘Submit’ button.

    Depending on the selected interest group, your users will will then have that interest group associated with their account inside of that specific MailChimp list.

    From their you can easily email certain interest groups, while leaving others out.

    Let us know if your having any difficulties. The video that I linked to above is fairly straight forward, and the directions are very good.

    To set up segments, you can set up your different segmented groups with in MailChimp. Once a user subscribes, depending on the conditionals you have set up, MailChimp will segment your users for you with no further interaction needed.

    Thanks,
    Evan

    Thread Starter Frank S

    (@frankswebsites)

    Hi there Evan,

    Thanks for the support! We created the groups now and I am sure they will be visible on the front-end if that is what you are saying.

    What we are looking to do, is track who filled out which form. So we would like to be able to add a field under water or a setting in the background which makes the subscriber a member of a certain group, segment, or even just place a “yes” in a custom field. Can we do one of these with your plugin?

    Thanks,
    – Frank

    Plugin Author Evan Herman

    (@eherman24)

    Hi Frank,

    Yes you can. Check the developer documentation for altering the data before it gets sent to MailChimp.

    https://www.ads-software.com/plugins/yikes-inc-easy-mailchimp-extender/other_notes/

    You can add a hidden fiield and automatically populate that field with the page or post name based on what page the user was on when they filled out the form.

    Thanks,
    Evan

    Plugin Author Evan Herman

    (@eherman24)

    Hi Frank,

    After some testing it appears that the yikes_mc_get_form_data filter isn’t properly altering the fields before being sent to MailChimp.

    I will need to take a look at what the issue may be, and make some alterations for future releases.

    You can still achieve this by creating a hidden field over on MailChimp, and then using the provided yks_mc_before_all_forms hook to add some CSS to hide the hidden field. Something like this:

    /**
        * This example will hide the mmerge1 field and label
        */
        function custom_before_all_forms_action() {
    		?>
    			<style>
    				label[for="0-adf9331235-mmerge1"], label[for="0-adf9331235-mmerge1"]+input {
    					display: none;
    				}
    			</style>
    		<?php
        }
        add_action( 'yks_mc_before_all_forms' , 'custom_before_all_forms_action' );

    After you have your field set up and hidden, you can use the same hook to write a little jQuery to populate the input field based on the current page or post. Something like this should point you in the right direction:

    <script type="text/javascript">
    				jQuery(document).ready(function() {
    					jQuery( '#0-adf9331235-mmerge1' ).val('<?php echo $page_title; ?>');
    				});
    			</script>

    The entire function would then go into your functions.php file, and would look similar to:

    /**
        * This example will hide the mmerge1 field and label
    	* and populate it with the current page title
        */
        function custom_before_all_forms_action() {
    		global $post;
    		$page_title = $post->post_title;
    		echo $page_title;
    		?>
    			<style>
    				label[for="0-adf9331235-mmerge1"], label[for="0-adf9331235-mmerge1"]+input {
    					display: none;
    				}
    			</style>
    			<script type="text/javascript">
    				jQuery(document).ready(function() {
    					jQuery( '#0-adf9331235-mmerge1' ).val('<?php echo $page_title; ?>');
    				});
    			</script>
    		<?php
        }
        add_action( 'yks_mc_before_all_forms' , 'custom_before_all_forms_action' );

    If you wanted to get even more specific you could specify the page URL
    in the field as well with a function similar to:

    /**
        * This example will hide the mmerge1 field and label
    	* and populate it with the current page URL
        */
        function custom_before_all_forms_action() {
    		$page_url = (isset($_SERVER['HTTPS']) == 'on' ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
    		?>
    			<style>
    				label[for="0-adf9331235-mmerge1"], label[for="0-adf9331235-mmerge1"]+input {
    					display: none;
    				}
    			</style>
    			<script type="text/javascript">
    				jQuery(document).ready(function() {
    					jQuery( '#0-adf9331235-mmerge1' ).val('<?php echo $page_url; ?>');
    				});
    			</script>
    		<?php
        }
        add_action( 'yks_mc_before_all_forms' , 'custom_before_all_forms_action' );

    You’ll want to adjust the mmerge1 name and the form ID to suit the needs of your form. You can find the name of that merge field inside of the manage lists page or over on MailChimp.com.

    You can also use the above function to target specific forms, instead of on all forms. And keep in mind you can alter the above function to populate the field with all sorts of data (username, current page ID, page title, page URL etc.)

    Hopefully that helps answer your question!

    Evan

    Joanne

    (@bluejpro)

    Hey Evan

    Thanks for the awesome plugin – and the function too.

    I’ve edited your function with my merge tag label. But for some reason the style rule and the jquery script don’t seem to be executing.

    What am I’m Missing?

    /**
        * This will hide the 0-5140a38f43-segment field and label
    	* and populate it with the current page URL
        */
        function custom_before_all_forms_action() {
    		$page_url = (isset($_SERVER['HTTPS']) == 'on' ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
    		?>
    			<style>
    				label[for="0-5140a38f43-segment"], label[for="0-5140a38f43-segment"]+input {
    					display: none;
    				}
    			</style>
    			<script type="text/javascript">
    				jQuery(document).ready(function() {
    					jQuery( '#0-5140a38f43-segment' ).val('subscribed to blog on <?php echo $page_url; ?>');
    				});
    			</script>
    		<?php
        }
        add_action( 'yks_mc_before_all_forms' , 'custom_before_all_forms_action' );
    ?>
    Plugin Author Evan Herman

    (@eherman24)

    Hi Bluejpro,

    Sorry I never saw your response. I don’t get emails for resolved threads. We’ve added the ability to pre-fill in the fields based on certain tags, or whatever you please in the latest release.

    You shouldn’t need this function any longer.

    Thanks,
    Evan

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to add subscriber to a segment or group’ is closed to new replies.