EarlyParrot subscribe call API on a Kartra opt-in page

Before we proceed – don’t want to integrate EarlyParrot yourself? Don’t have the resources to do or simply wish to have us set it up for you? We offer a done for you service, at a very reasonable price. Send us a request on [email protected] with your domain for further instructions.

For most EarlyParrot / Kartra users, theĀ opt-in pageĀ is the same page as the landing page, which is also most of the time the homepage. This guide will show you how to install the right scripts that will capture subscriber information and send it to EarlyParrot for processing.

The provided script will send Firstname (OPTIONAL), Lastname (OPTIONAL) and Email (mandatory) to EarlyParrot. This will:

  • Add a new subscriber to your referral campaign
  • Gives enough information to EarlyParrot to be able to decide whether the new opt-in has been referred or not.

To get this script integrated, locate the opt-in page in your Kartra account. Once you do that, then add the following script in a custom HTML element.

Please make sure you replace YOUR_CAMPAIGN_ID with your campaign id. Not sure how to get your campaign ID? check this tutorial out.

<script type="text/javascript">
  var epVars = {
    adminUrl: "https://admin.earlyparrot.com",
    appUrl: "https://app.earlyparrot.com",
    campaignId: "YOUR_CAMPAIGN_ID"

<script type="text/javascript" async="true" src="https://s3.amazonaws.com/earlyparrot-production-scripts/ep-landing-page.js"></script>

<script type="text/javascript">
  function enableCaptureOnSubmit () {
      var firstName = epJQuery('input[name="first_name"]').val(); 
      var email = epJQuery('input[name="email"]').val();
      if (undefined === firstName || undefined === email) {
      if ("" == firstName || "" == email) {
      var ep_subscribeObj = new Object();
      ep_subscribeObj.firstName = firstName;
      ep_subscribeObj.lastName = ' ';
      ep_subscribeObj.email = email;
      ep_subscribeObj.rh = Cookies.get('rh');
      ep_subscribeObj.sendWelcomeImmediately = 0; //will not send welcome email 
      Cookies.set('epSubmitEmail', ep_subscribeObj.email, { domain: window.location.hostname });
      epJQuery.post("https://admin.earlyparrot.com/api/campaigns/"+epVars.campaignId+"/subscribe", ep_subscribeObj)
          .then(function(data) { });

(function(w, d, url) {
    var headElementUtils = d.getElementsByTagName('head')[0];
    var scriptElementUtils = d.createElement('script');
    scriptElementUtils.addEventListener('load', function() {
        epJQuery(document).ready(function() {
    headElementUtils.async = 1;
    scriptElementUtils.src = url
})(window, document, 'https://s3.amazonaws.com/earlyparrot-production-scripts/utilities.js');