*|UNIQID|* Merge Tag

1,198 views
Skip to first unread message

Dan

unread,
Dec 29, 2011, 2:39:55 PM12/29/11
to MailChimp API Discuss
I would like to use this merge tag in my mail-outs as a unique prize
code. After each mail-out I would run a random query from all the *|
UNIQID|* merge tags send out and reveal the winning CODE for the mail-
out at my store.

I have one problem - I need to be able to get a list of all the *|
UNIQID|* for each mail-out. Can this be done via an API call. If yes,
which one?

Thanks
Danny

Winfred

unread,
Dec 29, 2011, 3:52:35 PM12/29/11
to MailChimp API Discuss
These Unique IDs are used when composing profile update and
unsubscribe links, so it's not really a good idea to pass it out to
other subscribers. (It's not clear if you were planning to or not, but
here it is just in case). Either way, listMemberInfo does provide this
UniqueID, although it may not be the most efficient way to calculate a
random winner.

Instead, it would be better to export the subscribers with the Export
API (unless they're already in your DB), and just rand[list_size] on
this dataset to pick a random subscriber and get their email address.
Email addresses are unique to a list, like the UniqueID. So for either
an internal "come to our store and tell us your address to see if you
won" or a "winning announcement campaign", using their email address
would be just as effective.

If wanting to announce the winner by campaign, then a campaign could
be customized with conditional merge tags to display the proper
content to the winner and losers, as described here:

http://blog.mailchimp.com/using-conditional-merge-tags-for-prizes/

Winfred

unread,
Dec 30, 2011, 8:44:10 AM12/30/11
to MailChimp API Discuss
Upon further discussion here, if not needing to synchronize databases
at all, it would be far more optimal to grab the member_count stat
returned from the lists(filters[list_id]) function.

http://apidocs.mailchimp.com/api/1.3/lists.func.php

Then generate a random number from this primitive integer (rather than
a whole dataset), and call listMembers(status=>subscribed,
start=>rand_num, limit=>1)

http://apidocs.mailchimp.com/api/1.3/listmembers.func.php

There would be much less unnecessary data movement this way, if you're
not wanting to maintain a separate, synchronized database of
subscribers as well with the Export API and some Webhooks.

http://apidocs.mailchimp.com/export/
http://apidocs.mailchimp.com/webhooks/
Reply all
Reply to author
Forward
0 new messages