Get Contact Field: An Ontraport + WordPress Shortcode Plugin

If you use Ontraport, you may have a WordPress membership website using Ontraport’s WordPress membership plugin called Pilotpress. When members are logged into your Pilotpress membership website, you have access to various information about them (contained in their Ontraport contact record) that you can retrieve using special shortcodes that Pilotpress enables–e.g., the user’s first name, their email address, and other information about them.

Well, I wanted to be able to retrieve this type of information from a contact record without the user having to be logged in to a membership website. So I wrote a plugin to do just that!

As long as someone is a cookied Ontraport contact, this plugin allows you to retrieve any information from the contact’s record in Ontraport–including any custom fields you may have created–and displaying it on any WordPress page, post, or in a widget.

Using the Plugin at your WordPress website

  1. You need to have an Ontraport account
  2. It’s a good idea to install a Ontraport tracking script at your WordPress website–or alternatively, install the Pilotpress plugin
  3. You need at least one Ontraport opt-in form at your website (which creates the Ontraport cookie)
  4. In Ontraport, generate a new API Key for the website where you will be using the plugin (if you haven’t already)
  5. Purchase and download the Get Contact Field plugin (the order form is also at the bottom of this post)
  6. Install and activate* the Get Contact Field plugin
  7. Go to Settings > “Get Contact Field” in the WordPress dashboard at the website where you’ll be using the plugin and put in the API key codes from #4 above and save them.

Some Code Examples

• Show the First Name for the cookied Ontraport contact:
[get_contact_field name=”First Name”]

• Show the Email address for the cookied Ontraport contact:
[get_contact_field name=”Email”]

• To display a custom welcome message to cookied contacts, you can use the Get Contact Field shortcode in combination with our free Show if Cookied shortcode.

For example to show a “Hi there Mike!” (or whatever their name is) message to a cookied contact:

[show_if_is_cookied]Hi there [/show_if_is_cookied] [get_contact_field name=”First Name”][show_if_is_cookied]![/show_if_is_cookied]

Operational Notes

  • If no browser cookie exists for your website visitor (i.e., they haven’t filled out a form at your website; or they have, but now they’re using a different computer or browser), then nothing will appear in the place of the shortcode.
  • The plugin includes error messages if you forget to specify a field name in your shortcode, or you specify one that doesn’t exist in your Ontraport account.
  • If you are creating and destroying browser cookies in the process of testing the shortcodes and they don’t seem to be working, make sure you clear the cache at your WordPress website if you are using one of those WordPress website caching plug-ins.
  • You only pay for the plugin once and will receive all/any future updates to the plugin.

Customer Case Studies

I’m really interested to hear how people end up using the plugin. Please come back to this post and share your stories (as comments on this post) about how you’re the plugin to do interesting and creative things!

*Installing a downloaded zipped WordPress plugin file:

From the WordPress plugin menu click on Add New:

Instead of searching for a plugin you can directly upload your
plugin zip file by clicking on Upload:

Use the browse button to select the plugin zip file that was downloaded, then click on Install Now. The plugin will be uploaded to your blog and installed. It can then be activated (find it on the Installed Plugins page and click the “activate” link under the plugin called “Get Contact Field”).

The Order Form

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.