App Store

AJAX Subscription Form

Developed by Campaign Monitor

Looking for a way to add subscribers to your lists without having to reload the page? Try this solution using jQuery.


The following offers a way to submit your subscription form via AJAX. This comes in handy when you’d like to add subscribers without having to reload the page, or send them to the default Campaign Monitor confirmation page.

This AJAX subscribe form uses jQuery and JSON to add subscribers to an existing subscriber list without needing to reload the page. On submission of the form, a subscription request is made from your browser to our servers. We reply with a response which includes details of the subscription result. If submission is successful, we show an alert that says, “Success”. If not, an ‘Error’ alert and reason are displayed. Of course, you can change this behaviour to suit your needs.

If you’re fairly experienced with JavaScript, the code should be straightforward to understand, however you’re more than welcome to post any questions you may have on the API developer forums.

The subscription result is a JavaScript object which contains three fields:

  • Status A number representing the subscription status. 200 if subscription was successful, or 400 if subscription was unsuccessful.
  • Message A string containing a message which describes the subscription status.
  • RedirectUrl A string containing a redirect URL, only if subscription is successful and you have set up a redirect URL for the list in your account, otherwise null.

Installation / Documentation

To customize this form you will need a basic understanding of CSS and JavaScript. If you have previously used v1 of this form, you will notice that we’ve removed the need for server-side code.

Here are some quick steps to get you started:

  1. Download/copy the latest version of the code from GitHub
  2. Paste your existing subscribe form in the area designated just after 1. Take your Campaign Monitor subscribe form… in the code. If you don’t yet have a subscription form on your site, here’s how to get one.
  3. Add this combined code to your site and voila, your form should submit via AJAX.
  4. Now feel free to customize everything to fit your needs.

After you paste in your subscription form, the script should be ready to use. We’ve tried to make this process as easy for you as possible.

Price: Free
Developer: Campaign Monitor
Contact: Contact support

Recommended apps

Privy Developed by Privy Acquire new email addresses using website popups and landing pages, then automatically sync them with your Campaign Monitor account.
List Builder and Smart Bar Developed by SumoMe Effortlessly grow your list with List Builder, a free and easy-to-install SumoMe app for creating clever pop-up subscribe forms
Hello Bar Developed by Hello Bar Add a customizable email collection bar right to your webpage quickly and easily using this simple integration.

See why 200,000 companies worldwide love Campaign Monitor.

From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that boost the bottom line.

Get started for free