Skip to main content

How to target Ontraport tags and fields in Mida

Connect Ontraport and show an A/B test or a personalization only to the contacts with the tags and custom fields you choose.

Connect Ontraport and Mida can show an A/B test or a personalization only to the contacts you choose, by tag or custom field. You paste your App ID and API Key, and add a short piece of text to the links in your Ontraport emails. There is no code to add to your site.

It also works the other way: Mida can save a survey answer, or any other attribute you choose, onto the contact in Ontraport.

Plan: targeting by Ontraport audience needs a paid Mida plan.

How it works

The short version: you add the contact's ID to the links in your Ontraport emails. Ontraport fills it in when it sends. When they click through, Mida reads the ID, looks the contact up in your account, and saves their tags and the custom fields you picked on their Mida visitor. Your targeting rules then read those values.

A finished link looks like this before Ontraport sends it:

https://yoursite.com/pricing?md_op=[Contact ID]

After the visitor lands, Mida removes md_op from the address bar.

What Mida copies

Data

What is copied

Name in Mida

Tags

Every contact tag in your account, saved as true when the contact has it and false when they do not. Always on.

op_tag_ plus the tag name, for example op_tag_customer

Custom fields

Only the fields you tick.

op_ plus the field name exactly as it is in Ontraport, for example op_Plan

Tag names are turned into lower case with underscores, so "Webinar Lead" becomes op_tag_webinar_lead. Field names keep their capitals and spaces. You do not have to work these out. Mida lists the exact name next to each one, and you can click it to copy.

Fields that link to another record, and list or drop-down fields, are not offered.

When targeting applies

  • Targeting applies from the visitor's next page view, not the page they land on from the email. The lookup runs in the background so it never slows your page or delays a test.

  • Mida keeps a person's data for up to 6 hours before asking Ontraport again. A change you make in Ontraport can take that long to show up in Mida.

  • Mida remembers the person in that browser, so they stay recognized on later visits. Another browser or device needs its own click from an email.

  • Visitors who never clicked one of your Ontraport emails stay anonymous and do not match any Ontraport rule.

Before you start

  1. In Ontraport, open Administration, then Integrations, then Ontraport API Instructions and Key Manager. Create a key if you do not have one. Copy the App ID and the API Key.

  2. Make sure the Mida tag is installed on the pages your emails link to.

Connect Ontraport

  1. In Mida, open Integrations and choose Ontraport under Marketing & Email.

  2. Click Enable Ontraport Integration.

  3. Open the Config tab.

  4. Paste the two values into App ID and API Key, then click Connect.

  5. When it says Connected, tick the fields you want to use under Attributes to bring in, then click Save attributes. You can pick up to 40.

Only an Owner or Admin can connect, replace the key, or disconnect. Tags need no setup: all of them are brought in.

Add the ID to your email links

In each Ontraport email or automation, add this to the end of every link that goes to your site:

?md_op=[Contact ID]

  • If the link already has a ? in it, start with & instead of ?.

  • If the link ends with a #section part, put the text before the #.

  • You can copy the exact text from the Ontraport Config tab in Mida.

  • It only works on links in emails Ontraport actually sends. In a preview the value is usually not filled in.

  • Insert the Contact ID with Ontraport's merge field picker in the link editor. If the picker inserts it in a different form than [Contact ID], use what the picker gives you.

Target a test or a personalization

  1. Open your test and go to Targeting.

  2. Add a Segment rule.

  3. In the attribute field, type the name from the Ontraport Config tab.

  4. Choose a condition and a value, then save.

You want to reach

Attribute

Condition

Value

Contacts tagged "Customer"

op_tag_customer

Is true

Known contacts who are not tagged "Customer"

op_tag_customer

Is false

Contacts whose "Plan" field is Gold

op_Plan

Is equal to

Gold

Everyone Mida has recognized from Ontraport

op_tag_customer (any tag)

Exists

A few things to know about conditions:

  • To target people who have something use Is true. To target known contacts who do not have it use Is false.

  • Anonymous visitors never match one of these rules, including "Is false" and "Does not exist". Mida knows nothing about them, so it leaves them out.

  • Text conditions are case sensitive. "Pro" and "pro" are different values.

  • All values arrive as text. Number and date conditions still work as long as the value looks like a number or a date.

For the full list of conditions, see How to use Segment & Event Filtering.

Send Mida attributes to Ontraport

Mida can also save attributes onto the matching contact in Ontraport. The usual case is a survey: a visitor answers "What is your team size?" on your site, and the answer is saved on their Ontraport contact, where your emails and automations can use it.

There is nothing extra to connect. Ontraport is written with the key you already pasted.

  1. In Ontraport, create a custom contact field for each attribute you want to receive, if it does not exist yet.

  2. In Mida, open the Ontraport Config tab. Under Send Mida attributes to Ontraport, tick the attributes you want to send, then click Save. You can pick up to 20.

What you can pick from

  • Survey answers: every question with Save the answer to the visitor turned on, shown with the question and its survey.

  • Attributes on your visitors: names Mida has seen on your recent visitors, for example ones you set with mida.identify(), with how many visitors carry each.

  • If an attribute has not reached a visitor yet, type its name in Not listed? and click Add.

The name must match the name of a custom field in Ontraport. Capitals do not matter, so team size matches a field named "Team Size". A name with no matching field is skipped, and Mida says so when you tick it.

How it behaves

  • It is only sent for visitors Mida has recognized from one of your Ontraport emails. Anonymous visitors are never sent.

  • If a visitor answers first and is recognized later, the answer is sent as soon as they are recognized.

  • Nothing is sent until a name is on the list. Mida never sends an attribute you did not list.

  • Mida never creates a new contact in Ontraport. It only updates ones that already exist.

  • The same value for the same contact is sent once an hour at most.

  • A value overwrites whatever was there before.

To stop, untick everything and click Save.

Test that it works

  1. Pick a tag that applies to you, and create a test that targets it.

  2. Add the link text to an email and send it to yourself as a real send, not a preview.

  3. Before you click, hover over the link in your inbox. You should see md_op= followed by a real value. If you see the placeholder text instead, Ontraport did not fill it in.

  4. Click the link in a normal browser window. Mida removes md_op from the address bar once the page loads.

  5. Go to another page on your site, or reload. You should now be in the test.

Privacy and consent

  • Mida copies only what is listed above and the fields you tick. Nothing else is read into Mida.

  • In the other direction, Mida sends Ontraport only the attributes you list under Send Mida attributes, and only for recognized visitors.

  • The values are saved on the visitor in Mida and used for targeting only. They are not sent back to the visitor's browser.

  • If you use Strict Consent Mode, Mida does not read or store the contact ID until the visitor gives consent. If consent is withdrawn, the stored ID is removed from the browser.

  • Mida never creates a visitor from a Ontraport lookup, so this does not add to your monthly tracked users.

  • Your API key is encrypted at rest and never shown again after you paste it. Mida reads from Ontraport with it, and writes only if you list attributes to send.

  • When you disconnect, Mida deletes the stored key and stops looking people up. Values already saved on visitors stay there, but they are no longer refreshed.

Limits

Limit

Value

Fields you can bring in

40 per project

Length of a field value

200 characters. Longer values are cut.

Contact tags in your account that Mida tracks

200

How long a contact's data is reused before Mida asks Ontraport again

Up to 6 hours

New contacts Mida looks up

About 40 a minute

Attributes you can send to Ontraport

20 per project

Ontraport allows 180 requests a minute per account, shared with every other tool connected to it, and Mida stays well under that. Right after a large broadcast, some visitors may be recognized a page view or two later than usual.

Troubleshooting

What you see

What to check

"Ontraport rejected this key"

Copy the App ID and API Key from the same row in the Key Manager. They only work as a pair.

The link in my inbox shows [Contact ID] as text

The email was a preview, or the merge field was typed rather than inserted. Insert it with the merge field picker and send a real email.

I clicked the email but I am not in the test

Targeting starts on the next page view. Load a second page. Also check the link had md_op in it and check the test's other targeting rules.

A field I need is not in the list

Fields that link to another record, and list or drop-down fields, are not offered. If it is a plain text or number field, contact us in the chat.

A survey answer is not showing up in Ontraport

Check that a custom field with that name exists, that it is ticked under Send Mida attributes, and that the visitor clicked one of your Ontraport emails in that browser.

I changed a contact in Ontraport and Mida has not noticed

Mida reuses a contact's data for up to 6 hours, and the list of tags and fields for 10 minutes.

FAQ

Does this work for visitors who never opened my emails?

No. Mida can only recognize someone after they click a link from one of your Ontraport emails. Everyone else is anonymous.

Do I need to change my emails?

Yes. Ontraport does not put a contact ID on links by itself, so you add the short text above to your links.

Will it slow down my site?

No. The lookup happens in the background after your page and your tests have loaded.

Can I connect more than one email platform?

Yes. A project can connect several, for example HubSpot as your CRM and another tool for email. Each is connected and set up on its own card. A visitor recognized by more than one gets each platform's data side by side, and an attribute you send goes to every platform that lists it.

Did this answer your question?