Contact Form 7

Before we begin:

  • The Contact Form 7 integration requires AffiliateWP 2.0 or higher.
  • For referral tracking of purchases/transactions, this integration requires both Contact Form 7 and the Contact Form 7 PayPal Add-on.
  • The Contact Form 7 integration can only list the 5 most recent forms.
  • The Contact Form 7 form plugin does not store form submission entries.  Given that, it will not be possible to view the data submitted on the form that generated the referral commissions for the affiliate.

AffiliateWP can track forms without a transaction, such as lead forms, as well as purchases, using the above-noted Contact Form 7 PayPal Add-on plugin.

The first section, Standard form submissions, details how to set up AffiliateWP and Contact Form 7 to track referrals generated from standard form submissions. For Standard form submissions, the only required plugins are AffiliateWP and Contact Form 7.

The second section, PayPal form submissions, details how to set up AffiliateWP, Contact Form 7, and the Contact Form 7 PayPal Add-on to track referrals generated from PayPal form submissions.

Standard form submissions

  1. Make sure AffiliateWP and Contact Form 7 are installed, and active.
  2. Activate the Contact Form 7 integration by checking Contact Form 7 in AffiliateWP » Settings » Integrations.
  3. Create a form as you would normally within Contact Form 7. Almost done! Now, proceed to the Affiliates » Settings » Contact Form 7 tab. You’ll see a settings page like this:
    Contact Form 7 integration setup

    Select whether all Contact Form 7 forms should have referral tracking enabled, or, enable referrals for a specific form only.  And finally, select the Referral Type: Sale, Opt-in or Lead. Note: The Contact Form 7 integration can only list the 5 most recent forms.

    Click Save Changes
  4. Form submissions will now be tracked by AffiliateWP for all selected forms. The generated referral will contain a unique reference ID (which is a combination of the form ID and the submission time), as well as the title of the Contact Form 7 form, which is used as the form referral description:
    The title of the Contact Form 7 form, which is used as the referral description for the Contact Form 7 integration.

PayPal form submissions

  1. Make sure AffiliateWP, Contact Form 7, and Contact Form 7 PayPal Add-on are installed, and active.
  2. Activate the Contact Form 7 integration by checking Contact Form 7 in AffiliateWP » Settings » Integrations.
  3. Now let’s add the PayPal account information in the Contact » PayPal Settings screen. After selecting your desired currency and adding your PayPal account email in the Live Account field, add a sandbox account if you’ll be testing things out first, and make sure to specify whether you’re testing in sandbox mode, or are ready to process real transactions ( “Off – Live Mode”).

    Contact Form 7 PayPal Add-on main plugin settings
  4. Scroll to Other Settings and provide both a Cancel URL and a Return URL:

    Specifying cancel and return URLs

    Most likely, you’ll just want to create two WordPress pages – one called “Order Cancelled” (or similar title), and one titled “Order Completed” (or similar title). AffiliateWP will use the pages entered here to either complete or cancel a referral, so it’s important the URLs correctly point to existing WordPress pages.

    Important: Setting up automatic return and cancel URLs is required to track referrals

    AffiliateWP tracks whether or not a PayPal transaction was completed, and uses the return and cancel URLs to do so. This information is used to provide relevant referral information.

    PayPal won’t automatically redirect your customers back to your website after the transaction is completed or cancelled. To enable automatic return and cancel URL redirects, please refer to this guide on the PayPal website.

    Make sure to save when finished! The save button is located at the top of the page here, and is easy to miss.

    Contact Form 7 - PayPal Add-on - Save button location
  5. Next we’ll create the form. AffiliateWP will track referrals generated from sales on this page, if this form is enabled. After creating your form, visit the PayPal tab on the settings page for that form. Enable PayPal for this form by checking the Enable PayPal on this form checkbox.

    Optionally, enter an Item Description, Item Price, or Item ID / Sku:



    Make sure to save your progress.
  6. Almost done! Now, proceed to the AffiliateWP » Settings » Contact Form 7 tab. You’ll see a settings page like this:



    Select whether all Contact Form 7 forms should have referral tracking enabled, or enable referrals for a specific form only.  Note: The Contact Form 7 integration can only list the 5 most recent forms.

    Click Save Changes.
  7. The generated referral will contain:

    A unique reference ID (which is either a PayPal transaction ID, if available, or a combination of the form ID and the submission time)

    A Product Description (if defined in the PayPal tab of the form) – which is used as the referral description.

    If the transaction is cancelled by the customer, the referral status will be set to rejected:

    Rejected referral

    If the transaction is completed by the customer, the referral status will be set to unpaid:

    Unpaid referral