Categories

Follow this Thread

Custom Field Keys and Personalization

Hi,

I'm finding that there's inconsistency in custom field keys used in the API. When I add a subscriber to a list via the API, I must use the Personalization Tag of the field as the custom field key. However, when I get the data back (i.e. getSingleSubscriber), the key used is the full Field Name. This seems odd and causes a number of exceptions I must code for.

Also, after discovering this, I thought for the sake of consistency (and sanity), I would just set the Personalization Tags to be the same as the Field Names, but this doesn't appear possible. Am I missing something?

That's really strange. For both adding a subscriber and getting the data back via GetSingleSubscriber. It should be the Field Name that is used. I've just tried this out, and found it to be so.

Could you possibly email support@campaignmonitor.com with your details, in particular the subscriber list and custom field that you're working on, and include the relevant code that you're using? Once you've done that, we can take a closer look at what's going on.

Thanks for the reply. I will admit that I haven't tried using the full Field Name as the key when _adding_ subscribers via the API (though I will go try this now). I haven't done so because your documentation explicitly says to use the Personalization Tag (minus the fallback text, of course) as the key for custom fields.

When retrieving a subscriber, I've done a simple loop through the custom fields and displayed the keys, and they're the full Field Names.

Then, add to this that that forms embedded on my site that submit directly to Campaign Monitor must use yet another value (something like cm-abcabc-abcabc), and there's a lot of different circumstances to account for.