WordPress integration plugin

To integrate Post Affiliate Pro (PAP) or Post Affiliate Network (PAN) with WordPress in order to track clicks, register new WordPress users as affiliates or to track the submission of contact forms generated by 'Contact form 7' WordPress module   you can take use of the WordPress plugin we created. The plugin can be downloaded at:
 
NOTE: If  you are going to use this plugin with a PAN installation, then only the network-owner login credentials would work. If you wanted to use this plugin only to integrate your WordPress site with the click tracking code, then no need to use the plug, just follow the alternative solution (option no. 1) found at:
https://support.qualityunit.com/504769-How-to-add-the-Click-tracking-code-into-a-WordPress-page
 
 
The plugin can be installed to WordPress as any other WordPress plugin - simply extract the downloaded .zip archive to the wp-content/plugins/ directory.  Afterwards in the dashboard (wp-admin) of your WordPress installation navigate to the Plugins section, search for "Post Affiliate Pro" and once you see the Post Affiliate Pro plugin in the list of plugins  click the Activate link under it. 
 
After the dashboard (wp-admin) refreshes you should see the PostAffiliatePro menu.
Clicking that menu item you would see a screen similar to this one:
 
 
where you are supposed to enter the connection details of your installation of Post Affiliate Pro. 
Into the Post Affiliate Pro URL field you would enter the full URL address (including protocol) of your installation of PAP/PAN while it has to end with a trailing slash. 
E.g. if your installation of PAP/PAN is available at https://anything.postaffiliatepro.com  then you would enter to that field:
https://anything.postaffiliatepro.com/
 
After you filled in the correct information to the required fields  and hit Save changes you should see a message like this one:
informing you of the successful connection to your installation of PAP/PAN
 
 

Tracking clicks

In order to enable tracking clicks just navigate to the PostAffiliatePro > Click tracking menu item in the dashboard and turn on the option of Click tracking integration enabled and hit Save Changes
 
 
If you are integrating Post Affiliate Network with WordPress and you are not the network owner, then instead of 'default1' you are supposed to type the ID of your merchant account to the Account name field. You can find the ID of your merchant account in the click tracking code inside the merchant panel (Tools > Integration > Clicks tracking) in the PostAffTracker.setAccountId('YourAccountWillBeHere') parameter.
 

Signup integration - register new WordPress users as affiliates

If you want the new users who register in your WordPress to become automatically affiliates then you need to turn on the 'Signup integration enabled'  option. But before you would do so make sure that inside PAP/PAN at Configuration > Affiliate signup there are no mandatory fields among the fields that can be disabled/enabled. Once this is done, you can navigate inside your WordPress installation to PostAffiliatePro > Signup options and turn on the Signup integration enabled option. 
 
 
The default options are ok, but if you wish to change any of them, feel free to do so. 
E.g. if you wish the new affiliates created via this plugin to be automatically signed up under a desired affiliate of yours (already existing in your PAP/PAN installation), then feel free to choose the desired affiliate from the Default Parent Affiliate list-box.
 
NOTE: If you are integrating PAN with WordPress and you are not the network owner, then by default the registration of new WP users as affiliates will not work. In order to have it work you would have to ask the network owner to grant you permissions to register affiliates.
Do not forget to click the Save Changes button at the bottom of the screen.
 
As you may see the plugin automatically recognizes the campaigns you have in PAP/PAN. In case of PAN it recognizes the campaigns belonging to the account defined in the PostAffiliatePro  > PostAffiliatePro screen where you entered the connection details of your installation of  PAP/PAN. 
If you have any private campaigns the plugin allows you to have the new affiliates to be automatically invited (added) to the particular campaigns.
 
 

Additional Integration

If  you wish to track the submission of contact forms generated by 'Contact form 7' WordPress module then navigate in the dashboard (wp-admin) to PostAffiliatePro > Integrations menu, turn on the Commision for every new contact option and click Save Changes.
 
 
Afterwards navigate to PostAffiliatePro > Integrations > Contact form 7 and there you can choose the campaign the tracking of form submissions is supposed to be associated with and you can also set the desired custom commission to be generated and if the data submitted in the form shall be saved in the Extra Data 1 field of transaction (commission) saved in PAP/PAN.
 

Using the Top Affiliates widget

If you navigate in your WordPress admin to Appearance > Widgets you might notice there the Top Affiliates widget
 
Once you click the Top Affiliates widget you will be presented a selection box where you can choose the position of the widget - where it will be displayed in your website.
 
Once you click Add Widget you will be presented with the configuration screen of the Top Affiliates widget:
The settings there are pretty intuitive. Once you save the settings and check your site you will notice the information generated by the widget. 
If you left the default options on then you would see the list of top affiliates  in the sidebar of your site as in the image below:
 
 

Using affiliate related shortcodes

Another great feature of the plugin is that it allows you to use different affiliate related shortcodes in your pages.
List of available shortcodes:
[affiliate item="name"/] - prints the name of currently loaded affiliate.
[affiliate item="loginurl"/] - prints a link labeled "Affiliate panel" by which the  affiliate can  log in to their affiliate panel
[affiliate item="loginurl" caption="Log me in!"/] - prints a link labeled "Log me in!" by which the affiliate can log in to their affiliate panel
[affiliate item="loginurl_raw"/] - prints raw (not clickable) url link. E.g.: https://URL_TO_PostAffiliatePro/affiliates/panel.php?S=sessionid
 
[affiliate item="OTHER_ATTRIBUTES"/] - prints other affiliate attributes. 
OTHER_ATTRIBUTES can be one of these items:
  • userid - id of affiliate
  • refid - referral id of affiliate
  • rstatus - status of affiliate
  • minimumpayout - amount of minimum payout of affiliate
  • payoutoptionid - id of payout option used by affiliate
  • note - note of affiliate
  • photo - url of the image of affiliate
  • username - username of affiliate
  • rpassword - password of affiliate
  • firstname - first name of affiliate
  • lastname - last name of affiliate
  • parentuserid - id of parent user (parent affiliate) of affiliate
  • ip - ip address from which the affiliate signed up
  • notificationemail - notification email of affiliate
  • data1 to data25 - data fields of affiliate

Example of getting user notification email:
[affiliate item="notificationemail"]
 
In our example we placed the [affiliate item="name"/]  to the text of the Sample Page (default sample page of WordPress)
 
 
If the sample page is visited by a not registered and not logged in customer, then it looks like this:
 
 
However, if the sample page is visited by a registered, logged in customer who is also an affiliate, then the page would look like this:
 
As you see, the [affiliate item="name"/]  shortcode has been dynamically replaced with the name of the logged in affiliate.