• Resolved pizzapie79

    (@pizzapie79)


    Hi, I’d like to assign different tags to subscriber according to site language… for example:

    • if a customer subscribe when the site language is italian, I’d like to assign tag “website-IT”
    • if a customer subsctibe when the site language is english, I’d like to assign tag “website-EN”

    I’m using WPML to manage different languages in my website; does your plugin supports WPML and tags for different languages? Is maybe possible to assign different tags according to language using a code snippet?

    Thanks in advance ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • KJ

    (@kjvextras)

    Hi there! That’s a great question!

    Regarding tags for different languages, the plugin allows you to add and customize tags based on user actions or settings, which can be managed programmatically. This capability can be utilized to apply different tags corresponding to the selected language or customer segment. So, yes! I would check out what is already available to you through MC and the plugin before trying custom code. Perhaps you could start here: https://mailchimp.com/help/all-the-segmenting-options/

    Thread Starter pizzapie79

    (@pizzapie79)

    Hi, thanks but I do not fully understand your reply.

    You said that the plugin allows to add tags programmaticaly, but then you linked Mailchimp documentation, not the plugin documentation. You mean I should try with some Mailchimp automation to add tags after the customer subscribes?

    I was hoping it would be a simpler way, since your plugin already can add tags to subscribers (Audience > Tag contacts from WooCommerce). Right now it would add the same tag to both italian and english subscriber since there’s only one field, but I was hoping that with some custom code snippets it would be possible to add different tags by language. Does your plugin provide some hooks or filter that can be used?

    Oterwise the only way for me is to try some Mailchimp automation to programmaticaly add tags based on some conditions.

    Thanks!

    Plugin Author ryanhungate

    (@ryanhungate)

    @pizzapie79 we have documentation on our WIKI page here that can help with any custom tags. There’s also a few other examples in this wiki to update merge tags and other customization options to the way we push data to Mailchimp. Let us know if you have any other questions about that!

    Thread Starter pizzapie79

    (@pizzapie79)

    Hi, really thank you for your reply!

    Ok, I’ve checked the WIKI and I think I could try with this code snippet:

    /* Mailchimp: add tags by language */
    function my_tags_by_language($tags, $email) {
    /* Add tag for italian website */
    if (ICL_LANGUAGE_CODE=='it') {
    $new_tags = array(
    array(
    'name' => '<<Italian website>>',
    'status' => 'active'
    ),
    );
    }
    /* Add tag for English website */
    if (ICL_LANGUAGE_CODE=='en') {
    $new_tags = array(
    array(
    'name' => '<<English website>>',
    'status' => 'active'
    ),
    );
    }
    return array_merge($tags, $new_tags);
    }
    add_filter('mailchimp_user_tags', 'my_tags_by_language', 10, 2);

    Before I add this snippet on my production website, can you please confirm if this snippet should work?

    Thanks in advance ??

    KJ

    (@kjvextras)

    Hi! I would try and add the snippet to a staging site prior to your production site – And testing it there.

    Thread Starter pizzapie79

    (@pizzapie79)

    Hi, the code snippet works!

    Thank you very much for your help ??

    Plugin Support khungate

    (@khungate)

    Glad to hear that fixed the issue @pizzapie79! If anything else pops up, don’t hesitate to reach back out to us. We appreciate you using the plugin.

    If you’re happy with this integration, please consider leaving a 5-star review. Your feedback helps other WooCommerce customers find this integration and helps support future development.

    Thread Starter pizzapie79

    (@pizzapie79)

    Hi, I already posted my 5-star review last time you helped me ??

    KJ

    (@kjvextras)

    You are amazing! Thanks so much for sticking with us and your support!

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.