Forum

Thread tagged as: Error, MailChimp

Mailchimp Interests

Hi,

I know it is an experimental feature, but I am struggling to get Mailchimp Groups/Interests to work. I have set up a Group, and got the following information from Mailchimp:

Home > lists > 02fecf19cd > interest-categories > caedddde6d
Details

list_id: 02fecf19cd
id: caedddde6d
title: Signup Source
display_order: 0
type: hidden

So my form now looks like this:

<perch:form id="subscribe" app="perch_mailchimp" double-optin="false">

<perch:content id="introtext" type="textarea" label="Introductory Message" size="s" markdown="true" editor="markitup" />

    <perch:success>
    <div id="mailchimp-success">
    <div id="success-message">
         <perch:content id="text" type="textarea" label="Thank you message" size="s" markdown="true" editor="markitup" />
        </div>
    </div>
    </perch:success>

    <div class="infieldlabel">
            <perch:input type="email" id="email" mailer="email" required="true"/>
            <perch:label for="email" class="infield required">Your Email Address</perch:label>
    </div>
    <div>
        <perch:input type="submit" value="Sign Up" id="btnsubmit" />
        <perch:input type="hidden" value="1" id="confirm" mailer="confirm_subscribe" />
        <perch:input type="hidden" id="list" value="02fecf19cd" mailer="list" />
        <perch:input type="hidden" id="testing" value="caedddde6d" mailer="interests" />
    </div>

</perch:form>

Does the id of the mailer="interests" input matter? Wasn't sure from the documentation. Anyway when I submit I get the following in debug:

Array
(
    [headers] => Array
        (
            [url] => https://us12.api.mailchimp.com/3.0/lists/02fecf19cd/members
            [content_type] => application/problem+json; charset=utf-8
            [http_code] => 400
            [header_size] => 417
            [request_size] => 432
            [filetime] => -1
            [ssl_verify_result] => 0
            [redirect_count] => 0
            [total_time] => 0.406381
            [namelookup_time] => 0.040375
            [connect_time] => 0.040982
            [pretransfer_time] => 0.182062
            [size_upload] => 98
            [size_download] => 160
            [speed_download] => 393
            [speed_upload] => 241
            [download_content_length] => 160
            [upload_content_length] => 98
            [starttransfer_time] => 0.406241
            [redirect_time] => 0
            [redirect_url] => 
            [primary_ip] => 104.82.238.170
            [certinfo] => Array
                (
                )

            [primary_port] => 443
            [local_ip] => 192.168.100.43
            [local_port] => 58849
            [request_header] => POST /3.0/lists/02fecf19cd/members HTTP/1.0
Host: us12.api.mailchimp.com
User-Agent: DrewM/MailChimp-API/3.0 (github.com/drewm/mailchimp-api)
Accept-Encoding: deflate, gzip
Accept: application/vnd.api+json
Content-Type: application/vnd.api+json
Authorization: apikey b8e0b18debe717ba1efe75f01703f85b-us12
Content-Length: 98


        )

    [body] => {"type":"https://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/","title":"Invalid Resource","status":400,"detail":"Invalid interest ID: 'caedddde6d'.","instance":""}
)

Am I going wrong somewhere that you can see? Without the interests input the form works fine.

Thanks!

Mike

Mike Harrison

Mike Harrison 37 points

  • 5 years ago

More Info

My Groups in Mailchimp look like this:

Signup Source
  |-Footer
  |-Checkout
  |-Splash

I am not sure if this has any bearing - it seems like the ID I have above only relates to the Signup Source, I can't find anything specific about the sections within it.

Drew McLellan

Drew McLellan 2638 points
Perch Support

The error is Invalid interest ID: 'caedddde6d' - so it looks like Perch is passing the value you've entered along correctly.

Yeah, I am thinking that represents my Interest Category rather than Interest, but I can't work out how to find the individual interest IDs

Cracked it - it was as I thought, I had the category id rather than the interest itself. Thanks anyway!