Passing URL String Variables to Prefill an Ontraport Form

If you are using the “Javascript Snippet” method of getting a Ontraport Smart form onto your WordPress page and want to automatically fill in a field on the form (e.g., firstname) using a URL string variable (e.g., ?fn=John), I got it to work using the following Javascript:

<script>
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
window.onload = setVar;
function setVar() {
var theform = document.getElementsByTagName("form");
theform[0].elements["firstname"].value=getParameterByName("fn");
}
</script>

Note: this assumes there’s one form on the page. If there are multiple forms on the page, the first one is referenced by theform[0], the second one by theform[1], etc.

Note 2: works with both visible and hidden form fields (I’m actually using it with a hidden field).

Integrating a WordPress Forum with Pilotpress Membership Levels

Let’s say you’ve created a membership website using Pilotpress (Ontraport’s WordPress membership plugin) and you would like to add a member forum. But you don’t just want a members-only forum (though you want that too) , you want to add multiple forums and/or sub-forums and have them be accessible only to certain Pilotpress membership levels–i.e., each forum/sub-forum can only be accessed by members in one or a few select Pilotpress membership levels.

When my company was still using the Wishlist Member membership plugin, the least expensive forum option we could find to work with WordPress and Wishlist Member was SimplePress. So, that’s what we used.

Upon moving from Wishlist Member to Pilotpress for our member website, we weren’t sure if SimplePress would still be our best option…though it would be easiest if we *could* make it work so we wouldn’t have to spend time configuring a new forum and trying to move posts and users to it.

Giving Pilotpress users access to SimplePress wasn’t a problem because new PilotPress logins generate new WordPress logins, and you can have SimplePress automatically assign new WordPress users/subscribers access to one or more forums.

The problem is you can only select one group to assign them to–i.e., you can select one group for all new members/subscribers to be assigned to.

But what if you want different Pilotpress membership levels to be assigned to different groups?…with only certain groups having access to certain forums/sub-forums? If we could come up with a way of doing this, we could continue to use the SimplePress forum plugin.

After digging into the SimplePress plugin code and doing some tests with the shortcodes provided by the PilotPress plugin, we developed a solution.

The Solution

First, we had to come up with a way to assign the currently logged in user to a previously set up SimplePress user group using a shortcode. So I developed a WordPress plugin that does just that. The shortcode it makes available looks like this:

[add_to_sp_group id=”19″]

..where id is the ID of the SimplePress group you want the user added to (the SimplePress group IDs are listed in SimplePress’s admin interface).

Second, we had to set up a way to assign users to SimplePress groups depending on their PilotPress membership level. We determined it could be done in conjunction with the PilotPress plugin in two ways:

  1. If there is a base/home page that only someone in a certain membership level can get to, and it’s a page that all users in that membership level have to pass through to get to any other of their protected pages, the “add_to_sp_group” shortcode can simply go on that page, and they’ll be added to the appropriate group upon visiting this page.
  2. The second method involves using the [show_if has_one=”Many,levels”] content [/show_if] shortcode provided by Pilotpress, on a page that all users logging into the member website have to pass through on their way to any other page in the membership website. For example:

[show_if has_one=”Gold”] [add_to_sp_group id=”3″] [/show_if]

…will assign the user to the SimplePress group with ID=3 if they are in the “Gold” Pilotpress membership level.

There is also a [remove_from_sp_group id=”3″] shortcode we made available in case there’s a reason to remove someone from a SimplePress group (for example: they moved to a new higher level membership and should not be participating in the forum at the lower membership level anymore).

BuddyPress Now Included Too!

Someone requested I include code in the plugin that works with the BuddyPress forum plugin. It turns out to be similar to what was needed for SimplePress, so new shortcodes for BuddyPress have been included too.

The new shortcodes are very similar to the shortcodes for SimplePress, except they use the abbreviation “bp” instead of “sp”. So, for example, to add someone to group with ID=4, you would use the following shortcode:

[add_to_bp_group id=”4″]

Requirements

The requirements to make this work are:

  • A WordPress website
  • An Ontraport account
  • Pilotpress installed at your WordPress website
  • SimplePress or BuddyPress installed at your WordPress website
  • The Forum Group Assign plugin installed* at your WordPress website
  • The creation of some forums or sub-forums and some groups in SimplePress or BuddyPress, along with assigning specific groups to specific forums
  • The creation of Pilotpress membership levels in Ontraport for the WordPress website

Once you’ve got all of these elements in place, you can start using the Forum Group Assign shortcode as described above.

If you find this plugin useful and would like to encourage me to provide other useful plugins for Ontraport and Pilotpress, please consider sending your appreciation to my PayPal account
( $5 / $10 / $15 )
..😀.

*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 “Forum Group Assign“).

Smart Form Prefill: An Ontraport + WordPress Shortcode Plugin

I wrote a WordPress plugin that renders an Ontraport smart form at my WordPress website using a shortcode that looks like:

[op_smartform id=”1″]

..where id is the ID of the smart form in the Ontraport app. Using a shortcode to specify a form versus a javascript snippet is helpful for us in a couple of ways, one of which is that I don’t have to actually go into a form and then to “publish” to get the code from the Ontraport app, I just have to hover my mouse over the form link in the listing of forms to get the ID.

While I was at it, I added the additional feature that the form will automatically prefill with the user’s contact info if they have an Ontraport cookie at my website as the result of having filled out some other form at my website in the past (or if they’ve logged into Pilotpress). This automatic prefill feature is the default behavior of the shortcode.

If I don’t want the form to prefill and/or want the form to render faster (it takes a little longer for it to prefill, though it’s not too slow even then), I’ve added a “switch” to turn off prefilling:

[op_smartform id=”1″ prefill=”no”]

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. In Ontraport, generate a new API Key for the website where you will be using the plugin (if you haven’t already)
  4. Purchase and download the Smart Form Prefill plugin (the order form is also at the bottom of this post)
  5. Install and activate* the Smart Form Prefill plugin
  6. Go to Settings > “Smart Form Prefill” in the WordPress dashboard at the website where you’ll be using the plugin and put in the API key codes from #3 above and save them.

Some Code Examples

• Render an Ontraport Smart Form with ID=4 and Prefill with Contact data if contact is cookied:

[op_smartform id=”4″]

• Render an Ontraport Smart Form with ID=4 and *don’t* Prefill with Contact data:

[op_smartform id=”4″ prefill=”no”]

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 the form will be rendered but not prefilled.
  • The plugin includes error messages if you forget to specify a form ID 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.
  • Please email me at mgm at WordPressAndOntraport.tech if you have any questions or run into any problems trying to install 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 “Smart Form Prefill”).

The Order Form

Retrieving Ontrapage Visit & Conversion Data as .CSV Download

Sometimes, it’s easier to download data into a spreadsheet to analyze it–for example, data about your Ontrapages (e.g., visits and conversions).

The Ontraport app provides a columnar view of your Ontrapages that you can sort by overall visits or conversions. However, it doesn’t have a column for “conversion rate” (conversions per visit) and it doesn’t list your pages by versions (unless you go into the stats for an individual page) so you can compare across both pages and their various versions (which you’ll have if you’re doing A/B or A/B/C/D testing within your pages).

I thought it would be helpful to download my Ontrapage data into a spreadsheet to do more extensive analyses using the following columns/fields:

Page Name Page Version Visits Conversions Conversion Rate

It turns out to be relatively easy to output the Ontrapage data using PHP and the Ontraport API. I wrote a script that you can download here.

To get this script to work, you need to have FTP access to a webserver set up to run PHP scripts (note: if you have a WordPress website, your server is able to execute PHP scripts).

Steps:

  1. Download and unzip the file from the link above
  2. Open the extracted PHP file (“download_ontrapages_data_csv.php”) and open it in a text editor
  3. Replace the x’s with your Api-Appid and Api-Key you’ll find for your WordPress website in the Ontraport app. If you have Pilotpress installed at the website, you can look in your Pilotpress settings at the website to get them. Save your changes.
  4. ‘Api-Appid: xxxxxxx’,
    ‘Api-Key: xxxxxxxx’
  5. Upload the updated “download_ontrapages_data_csv.php” file to your WordPress webserver; it can be in almost any directory on your server (you can create a “scripts” folder at your server and put it there if you want).
  6. Link to the uploaded file from a page at your website; your link should look something like http://yourwebsite.com/scripts/download_ontrapages_data_csv.php
  7. After saving the page with the link, view the page in a browser and click the link. It should open a dialog that asks if you want to download or open the file it’s about to download (“file.csv”).

If you open the file in Excel, it’ll look something like this:

That’s it! If you are unfamiliar with FTPing files to a server, maybe you’ve got a programmer-type friend who would give you a hand..:).

Contact Product Purchases: 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 makes available. Pilotpress also provides a customer center where customers can update their purchase and login info, and where they can view their subscriptions, payment plans, and some of their purchase history (the latter is somewhat limited).

One thing that neither the Pilotpress shortcodes nor the Pilotpress customer center makes easily available is a list of the products and services the contact has purchased from you.

As a Ontraport user myself, I wanted a way to provide a list of products/services purchased by each of my customers they could see at the membership website.

So I decided to write a WordPress plugin that provides a simple list of the products the customer has purchased, showing the original purchase date, and sorted in reverse order, last purchase first.

The list of the products is displayed like this:

  • Product or Service’s Name #1 (original purchase: Nov 17, 2017)
  • Product or Service’s Name #2 (original purchase: Oct 09, 2017)
  • Product or Service’s Name #3 (original purchase: Jun 28, 2017)

The <ul>and <li> tags used in the HTML coding of this list specify their own classes (“prod_ul” and “prod_li” respectively) so you can style them using CSS.

Using the Plugin at your WordPress website

  1. You need to have an Ontraport account
  2. You need to have the Pilotpress plugin installed at your WordPress membership website
  3. In Ontraport, generate a new API Key for the website where you will be using the plugin (if you haven’t already)
  4. Purchase and download the Contact Product Purchases plugin (the order form is also at the bottom of this post)
  5. Install and activate* the Contact Product Purchases plugin
  6. Go to Settings > “Contact Product Purchases” in the WordPress dashboard at the website where you’ll be using the plugin and put in the API key codes from #3 above and save them.

Code Examples

Simply put the following shortcode on a WordPress post, page, or in a widget:

[contact_product_purchases]

If you want to *exclude* certain products, include a list of the Ontraport product IDs as follows:

[contact_product_purchases exclude=”2,12″]

Operational Notes

  • If the user has no purchases, then rather than a list, the following will be displayed: “*** No Products Found ***”
  • This plugin lists each product only once and displays the date of the first time it was purchased; if a product is purchased on a payment plan–or as a subscription–it lists the date of the first payment.
  • Only products with a “Paid” status in the contact’s Ontraport record will be shown.
  • 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 “Ontraport Contact’s Product Purchases”).

The Order Form

Using the Ontraport API for a Taxable Monthly Subscription with a Trial Period and Recurring Invoice

I recently had to work out how I would use the Ontraport API (specifically the process Manual endpoint: https://api.ontraport.com/live/#!/transactions/processManual) to process a taxable monthly subscription with a first month trial period at a reduced rate, and included the new feature of being able to send a recurring invoice each time the subscriber is charged. The trick is specifying the json input string in the correct way.

I’m posting the json input string I found to work as an example for others because I was unable to find an example that was anywhere near what I was trying to do, and it required a lot of trial-and-error to find a string that worked.

Please note that you will have to replace variables you see in { braces } with the actual value of the number or string you want to use.

Here is the json input string:

{
  "contact_id": {contact id},
  "chargeNow": "chargeNow",
  "invoice_template": {invoice id},
  "gateway_id": {gateway id},
  "offer": {
    "send_recurring_invoice": true,
    "products": [
      {
        "quantity": 1,
        "shipping": false,
	"hasTaxes": true,
        "tax": true,
	"taxable": true,
        "price": [
          {
            "price":"47.00",
            "payment_count": 1,
            "unit": "month"
          }
        ],
        "trial": {
            "price":"40.00",
            "payment_count": "1",
            "unit":"month"
         },
        "type": "subscription",
        "delay_start": 0,
        "id": {subscription product id}
      }
    ],
    "taxes":[{
        "taxShipping":"false",
        "name": {e.g., "NY Sales"},
	"id": {tax id}
    }]
  }
}

In my PHP script that applies this input toward the Ontraport API processManual endpoint, I make the tax ID = 1 if their billing state is New York (we have a NY Sales tax defined in Ontraport, and it’s ID is 1); otherwise, I set the tax ID to 0 and no tax is charged.

I hope someone else finds this helpful!

WordPress Plugin with “Smart” Pilotpress Login Form

People who have built a Ontraport membership website using the Pilotpress WordPress plugin have reported that their users sometimes have trouble logging in or will appear to be logged in but won’t see any of the membership content on the page.

The source of the problem seems to be that the login to Pilotpress can get out of sync with the WordPress login. The user can be logged out of Pilotpress but still logged into WordPress. When this happens, the user can experience trouble trying to log in (because WordPress thinks they’re already logged in), or they don’t see membership content because they aren’t logged into Pilotpress, but the website behaves as though they’re logged in because they are logged into WordPress.

Since I am one of these Ontraport Pilotpress website owners with users experiencing this problem, I sought a solution using some WordPress PHP programming…and was able to fashion a WordPress plugin that resolves the problem..(!)

With this plugin, instead of using Pilotpress’ [login_page] shortcode to display the login form to your members, you use [pp_login_form].

If the user is properly logged out of both Pilotpress and WordPress, the login form displayed by [pp_login_form] will be the same exact one you would get using Pilotpress’ [login_page] shortcode.

However, if the user is logged out of Pilotpress but not properly logged out of WordPress, the user will instead see the message: “You are logged out. Please Log In” where “Log in” is a link to click. Clicking the link properly logs the user out of WordPress and then displays the Pilotpress login form.

Notes:

  1. if the user is properly logged into both Pilotpress and WordPress, no form or message is displayed and the user sees the membership content on the page that they’re supposed to see.
  2. the [pp_login_form] shortcode can be used in a text widget (e.g., in a side bar or footer) to make it available on many/all pages throughout your WordPress website

Using this Plugin at your WordPress website

Once you have installed and activated* the “Conditional Pilotpress Login” plugin, you can start using it on any page or post at your WordPress website. Simply place the shortcode [pp_login_form] wherever you would normally (or where you currently have) the Pilotpress [login_page] shortcode.

Please note: you can style the “You are logged out. Please Log In” message if you’d like by using the “logged_out_msg” class specified in the DIV tag that surrounds the message in the HTML code.

If you find this plugin useful and would like to encourage me to provide other useful plugins for Ontraport and Pilotpress, please consider sending your appreciation to my PayPal account ( $5 / $10 / $15 )..
😀.


*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 “Conditional Pilotpress Login Form”).

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

Contact is Tagged: 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.

There are also shortcodes that allow you to show or hide content on your WordPress pages based on whether a user (called a “contact” in Ontraport) belongs to a certain membership level or has been added to a particular “tag” (an Ontraport means for describing the contact and categorizing them based on actions they have taken on your pages–like purchasing a certain product, filling out a certain opt-in form, and so on).

Well, being an Ontraport user myself, I wanted to find a way to display different content at our WordPress website based on these tags and without the contact having to be logged into the website…because not all of our customers have memberships and/or logins to our websites.

So what I wanted was a shortcode that copies the behavior of the Ontraport [show_if has_tag=”Tag”] content [/show_if] shortcode (also a shortcode for showing content if they *don’t* have a tag), but does it for cookied Ontraport contacts *without them needing to be logged in*. They just need to have filled out an Ontraport form at the WordPress website where you’re using the shortcode/s.

Well, I went ahead and wrote a WordPress plugin to do just that!

I can think of many possible applications of this functionality.

One application that someone in the Ontraport User Community Facebook group mentioned is having an Ontraport form and a thank you page at the same website and having the thank you page display different content based on the tags in the form filler’s contact record.

Other applications are showing different products to each visitor to your website based on what they’ve already purchased from you in the past. This could consist of hiding stuff they’ve previously bought, or showing other products you have available that are related to their past purchases.

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 Contact is Tagged plugin (the order form is also at the bottom of this post)
  6. Install and activate* the Contact is Tagged plugin
  7. Go to Settings > “Contact is Tagged” 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

Content you want to show to a visitor with the “Has Purchased Product A” tag:

[contact_is_tagged with=”Has Purchased Product A”]My HTML content here[/contact_is_tagged]

Content you want to show to a visitor who doesn’t have the “Has Purchased Product A” tag:

[contact_is_not_tagged with=”Has Purchased Product A”]My HTML content here[/contact_is_not_tagged]

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 the content between your “Contact is Tagged” shortcodes will simply not appear (i.e., nothing is shown).
  • The plugin includes error messages if you forget to specify a tag 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 “Contact is Tagged: Show Content if Contact has or doesn’t have a Specified Tag”).

The Order Form

An Ontraport “Show if Cookied” Shortcode

If someone fills out an Ontraport form at your WordPress website at which you’ve installed an Ontraport tracking script, a browser cookie is created on that person’s computer–for the particular browser they used when the filled out the form–that lets your website know this person has come to your website previously and filled out a form.

Apparently, there used to be Ontraport shortcodes you could use to show or hide content based on whether the visitor possessed this “form was previously filled-out” cookie. To use it, you would surround content you wanted only cookied visitors to see with this shortcode:

[show_if is_cookied]Content for Ontraport cookied visitors to see[/show_if is_cookied]

There was also a shortcode for showing content to visitors without the cookie:

[show_if not_cookied]Content for visitors without the Ontraport cookie to see[/show_if not_cookied]

Well, Ontraport stopped supporting these shortcodes because, I believe, they weren’t actually working.

But I found myself with a situation where I really wanted this functionality. So, what to do?

I went ahead and created a WordPress plugin that brings this functionality back!

The only difference in the shortcode I created is that I got rid of the single space in the shortcodes because that seemed potentially problematic, though I don’t know whether it actually mattered.

In any case, I changed the shortcodes to [show_if_is_cookied] and [show_if_not_cookied].

Using this Plugin at your WordPress website

Once you have installed and activated* the “Show if Cookied” plugin, you can start using it on any page or post at your WordPress website. Just surround your HTML content you want to show or hide as follows:

Content you want to show to visitors with the Ontraport cookie:

[show_if_is_cookied]HTML content to show to visitors with the Ontraport cookie[/show_if_is_cookied]

Content you want to show to visitors who do not have the Ontraport cookie:

[show_if_not_cookied]HTML content to show to visitors without Ontraport cookie[/show_if_not_cookied]

Come back and post comments if you’re finding this a useful plugin!

Note: if you test 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.


*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 “Show cookied/not-cookied Ontraport Content”).