Ometria — Upsert Contact

Ometria is a customer data and experience platform for retail brands. It keeps a profile for each customer and uses those profiles to send marketing messages across channels, such as email, SMS, and mobile push.

Create or update one Ometria contact for a customer as soon as a real-time journey reaches an Activate node, using the push endpoint. Each send writes one contact with the attributes that the node maps. Amperity asks Ometria to update the contact in place, so a field that the node does not map, or that has no value for the customer, keeps the value Ometria already has.

The same send can add the contact to Ometria lists, or remove it from them. The Ometria app shows these lists as static segments. To start an Ometria campaign that begins when a contact enters a segment, add the contact to that static segment.

This connector sends from a real-time journey. See Real-time destinations.

Beta

The Ometria — Upsert Contact connector is in beta. Contact your Amperity representative to learn more.

Requirements

  1. An Ometria API key that is not limited to translations. Only an Ometria administrator can create one. See creating a new API key in the Ometria documentation.

  2. When your other systems send Ometria a customer ID for each customer, an Amperity attribute that holds that ID. Without one, Amperity writes each contact under the customer’s Amperity ID. See Customer ID attribute under Activate node settings.

  3. The list IDs of any Ometria static segments that the journey adds contacts to or removes them from. See adding a contact to or removing it from a segment or list for where to find a list ID. Amperity does not create lists, and does not check that a list exists.

Credentials

This connector uses the “ometria” credential type, which holds one value: an API key.

Name and description

The name and description for a credential.

API key

An Ometria API key, which only an Ometria administrator can create. The key must not be limited to translations. A new key can take about 10 minutes to start working. See creating a new API key in the Ometria documentation.

Amperity sends the API key in the “X-Ometria-Auth” header of each request.

When you save the destination, Amperity tests the connection by listing the account’s contact collections with GET https://api.ometria.com/v2/contacts. The request reads only collection names and counts, and changes nothing. When Ometria answers with 403, the test reports a credential error and asks you to check that the API key was copied whole, has not been revoked, and is not limited to translations. A key that was created in the last 10 minutes may not work yet; test the connection again shortly. Other failures report the same messages as a failed send, as described under Failed sends.

Settings

Name and description

The name and description for a destination.

Business user access

By default a destination is available to all users who have permission to view personally identifiable information (PII).

Enable the Admin only checkbox to restrict access to only users assigned to the Datagrid Operator and Datagrid Administrator policies.

Enable the PII setting checkbox to allow limited access to PII for this destination.

Use the Restrict PII access policy option to prevent users from viewing data marked as PII anywhere in Amperity and from sending data to downstream workflows.

Collection

Optional. The Ometria collection that Amperity writes contacts to. Defaults to “amperity”, which Amperity also uses when the setting is blank. Amperity sends the name exactly as entered.

Ometria combines a customer’s contacts from every collection into one profile, matching on customer ID and then on email address, so a collection of Amperity’s own does not overwrite the contacts that another source writes. See contacts .

This connector has no other destination settings. Everything else is configured on the Activate node.

Activate node settings

The rest of the configuration for this connector belongs to the journey that sends to it. Add this destination to an Activate node, then configure the following fields on the node’s Payload tab. All of them are optional.

Customer ID attribute

The Amperity attribute that holds the customer’s Ometria customer ID. Use the ID that your other systems send to Ometria for the same customer, so that the contact Amperity writes belongs to that customer. Never use personal data, such as an email address, as the customer ID.

When this field is not set, Amperity sends the customer’s Amperity ID as the customer ID. An Amperity ID can change when Amperity resolves a customer’s records again; the next send for that customer then writes a different contact, under the new ID. Map an ID that does not change to keep one contact for each customer.

Amperity sends the customer ID as both the contact’s “id” and its “customer_id”. Amperity removes spaces from the start and end of a text value, and sends a whole number as text. A customer with no value for the attribute is not sent: there is no fallback to the Amperity ID. Other values that Amperity does not send are listed under Checked before sending.

Contact fields

The Amperity attributes to write to the contact. Select Edit to map Amperity attributes to field names on the Attributes tab, or to add fixed values on the Custom attributes tab.

A field name that is one of the following standard Ometria contact fields, spelled exactly as shown, is written to that field:

  • “email”

  • “phone_number”

  • “prefix”

  • “firstname”

  • “middlename”

  • “lastname”

  • “gender”

  • “date_of_birth”

  • “postcode”

  • “city”

  • “country_id”

  • “timezone”

  • “preferred_lang”

  • “marketing_optin”

  • “timestamp_acquired”

  • “timestamp_subscribed”

  • “timestamp_unsubscribed”

When a field name matches one of these in different case, such as “Email”, the editor suggests the exact spelling. A field name that is not one of these is written as a custom property on the contact, in its “properties” object, using the name exactly as entered.

The editor does not accept the following field names, in any case, because Amperity sets them itself or cannot send them: “@type”, “@collection”, “@merge”, “@add_to_lists”, “@remove_from_lists”, “@force_optin”, “id”, “customer_id”, “properties”, “channels”, “subscriptions”, “extra_identifiers”, and “store_ids”.

How Amperity sends each value:

  • An attribute with no value, or with blank text, is left out. Amperity never sends an empty value, so Ometria keeps the value it already has for that field.

  • The standard contact fields listed above take text. Amperity sends a whole number as text. A decimal number, or a value of another type, is not sent, as described under Checked before sending.

  • “email” has spaces removed from its start and end, and is sent in lower case.

  • “country_id” has spaces removed from its start and end, and is sent in upper case.

  • Dates and timestamps are sent as ISO 8601 text, such as “1990-04-21” for a date.

  • Other values are sent unchanged. Amperity does not check or convert “phone_number”, “postcode”, “city”, “timezone”, “preferred_lang”, or the three timestamp fields, beyond the length limits listed under Checked before sending. See push for the values Ometria accepts in each contact field.

  • Custom properties are sent with their type, unchanged, except that dates and timestamps are sent as ISO 8601 text.

A value that Ometria does not accept can fail the send, without another attempt, or can be accepted by Ometria and not stored, as described under Failed sends.

Add to lists

The list IDs of the Ometria static segments to add the contact to, as whole numbers separated by commas, such as “12,34”. Amperity ignores spaces around each ID, and empty entries. Each ID must be a whole number of up to 16 digits; any other value fails every send from the node, without another attempt. Amperity does not check that the lists exist.

Remove from lists

The list IDs of the Ometria static segments to remove the contact from, in the same form as Add to lists.

Request body

Amperity sends each send as one request to POST https://api.ometria.com/v2/push. The request body is a list that holds one contact. Every contact has “@type” set to “contact”, the destination’s collection in “@collection”, and “@merge” set to true. Amperity adds “@add_to_lists” and “@remove_from_lists” only when the node sets them, and “properties” only when the contact has custom properties.

For example, with no Customer ID attribute, contact fields named “email”, “firstname”, “country_id”, and “loyalty_tier”, and Add to lists set to “12”, Amperity sends:

[
  {
    "@type": "contact",
    "@collection": "amperity",
    "@merge": true,
    "id": "0a1b2c3d-4e5f-6789-abcd-ef0123456789",
    "customer_id": "0a1b2c3d-4e5f-6789-abcd-ef0123456789",
    "email": "jordan@example.com",
    "firstname": "Jordan",
    "country_id": "GB",
    "properties": {
      "loyalty_tier": "gold"
    },
    "@add_to_lists": [12]
  }
]

Checked before sending

Before it sends a contact, Amperity checks it against the following rules, and no others. When a check fails, Amperity sends nothing, and the send fails without another attempt. The failure message names the node field or the contact field to fix, and never includes the customer’s values. Amperity reports one failure at a time: it checks the customer ID and the list IDs first, then the contact fields in alphabetical order, and then the size of the contact.

  • The node sets Customer ID attribute, and the customer has no value for it, or the value is blank.

  • Add to lists or Remove from lists holds a value that is not a whole number of up to 16 digits.

  • The customer ID is not text or a whole number, such as a decimal number.

  • The customer ID contains “@”.

  • The customer ID is longer than 255 characters.

  • One of the standard contact fields listed under Contact fields holds a decimal number, or a value of another type that is not text. Custom properties are not checked for type.

  • “email” is longer than 255 characters; “firstname”, “middlename”, “lastname”, or “timezone” is longer than 64 characters; or “prefix” is longer than 16 characters.

  • “gender” is not “m”, “f”, or “o”.

  • “prefix” is not “Mr”, “Mrs”, “Miss”, or “Ms”.

  • “marketing_optin” is not “EXPLICITLY_OPTEDIN”, “EXPLICITLY_OPTEDOUT”, or “NOT_SPECIFIED”.

  • “email” does not contain “@”.

  • “date_of_birth” is not in the form “YYYY-MM-DD”. A date attribute is sent in this form; a timestamp is not.

  • “country_id” is not two letters from A to Z, such as “GB”, after Amperity changes it to upper case.

  • The contact is larger than 61,440 bytes (60 KB), measured once it is encoded as JSON.

These values are case sensitive: “M” is not accepted for “gender”, and “MR” is not accepted for “prefix”.

The second is a problem with the node’s settings, and fails every send from that node until it is fixed. The others are problems with one customer’s data, and fail only that customer’s send.

A contact that passes these checks can still be refused by Ometria, as described under Failed sends.

Failed sends

Amperity makes up to three attempts at each send. Each new attempt is scheduled between 200 and 700 milliseconds after the previous one fails, with no backoff, so all three attempts are made within a few seconds. Amperity does not retry a request within an attempt.

How Amperity handles each failure:

  • 403. The send fails without another attempt. Check that the API key was copied whole, has not been revoked, and is not limited to translations. A key that was created in the last 10 minutes may not work yet. A key that Ometria refuses fails every send until it is fixed. Amperity reuses its connection to Ometria for each credential for up to 20 minutes, so after you edit the credential, sends can keep using the old key for up to 20 minutes. Choosing a different credential for the destination takes effect at once.

  • 429. Amperity makes another attempt, up to three in all. A rate limit that lasts longer than the three attempts fails the send. Ometria applies its rate limit to the whole account, shared by every integration that sends to it, so other integrations can cause these failures. See the data API introduction .

  • 408 or a server error (500 or higher). Amperity makes another attempt, up to three in all.

  • 400 or 413. Ometria refused the contact as malformed or too large. The send fails without another attempt. Check the attributes mapped to contact fields on the node.

  • Any other status, such as 401 or 404. The send fails without another attempt. If it keeps happening, contact Amperity support.

  • No answer, such as a timeout or a dropped connection. Amperity makes another attempt, up to three in all.

Ometria can also answer with success and report that it did not take the contact: its answer has a “status” of “ERROR”, or counts the contact as neither accepted nor skipped. The send fails without another attempt. When Ometria includes a request ID in its answer, the failure message includes it, for Ometria support to look up.

Any other failure of a request to Ometria is reported as an unexpected error, and the send fails without another attempt.

A failed send and its failure message appear in two places:

  • The Recent failures table on the Profile sends tab of the Destinations page. The tab is available when real-time profiles are enabled for your tenant.

  • The Activations tab of the customer’s profile, which also shows the send’s Attempt count, such as “3 / max 3”.

Amperity keeps only the failure message from the last attempt. A failed send cannot be retried from Amperity.

Every attempt at a send sends the same contact, including its list changes. When Ometria received a contact but answered with 408 or a server error, or its answer did not reach Amperity, the next attempt sends the contact again.

Amperity reports the send as successful when Ometria counts the contact as accepted or skipped, or answers with success and no counts. Amperity does not check whether Ometria stored the contact after accepting it, or whether a list change started a campaign. See list errors for how to list the contacts that Ometria accepted and then rejected.

Amperity limits how quickly it sends requests to Ometria with each credential.