:::: MENU ::::

Auto-import contacts into your getresponse campaign with pure javascript

Getresponse is email marketing software used by many online product companies. When users come to a product site then they make the purchase and pay through clickbank or any other checkout processing gateways.

So, after successful transaction you need to configure your payment gateway to redirect back user to your site with ┬ásome querystring retailed that contains customer’s name and email.

Example Click-bank after transaction url

Should be redirct to your site with buyers’ name and email

Now we know that querystring contains,

So we can code a script on this orderconfirm.php page that will auto send this information to getresponse form api.

Basic Setup:-

  1. Login to your GetResponse account.
  2. Find Web Forms from Top menu.
  3. Click Create New
  4. Choose Design
  5. Then in settings, fill up Web Form Name, Turn off Confirmed opt-in (so user will be directly confirm without verification email) and choose Stay on current page
  6. Click advance and choose campaign for subscription, choose welcome message and set other criteria.
  7. Click Next and Look into Show HTML Code (turn off include css styles)
  8. Get HTML code into notepad.

Find the webform _id from your HTML code

and then, create and paste it in this HTML form on confirmation.php

Include GetResponse script file in your order confirmation page.

Initialize Script at bottom of your page (just before </body> tag)

You can see you could customize querystring parameters cname & cemail in above options. Even specify form fields identifiers.

Script Code

Above script will,

  • Set all options supplied into init() options.
  • Then parse querystring and read cname and cemail variables
  • Fill them into GetResponse HTML form.
  • After that It’ll create hidden iframe.
  • Finally submits form into it.
  • So that these email and name will be auto-imported into your GR campaign.
  • Here, no jQuery or other library = pure javascript.

So, what do you think ?