WordPress Plugin # 3 – Tracking Affiliate Cookie

Summary:
Take the existing affiliate code by WPMUDev and add these features and changed functionality.
The way it current works is that the affiliate tracking cookie is dropped only when the affiliate link is used to have a new visitor enter the site. This is not functionally adequate and needs to be upgraded.

Details:

A cookie to track the referring blogger needs to be created when a new visitor first enters the WordPress Multi-User website of the blogger. This cookie can be created for any Post, Page, Search Result, Index and every other page that gets displayed.
The example URL’s should all have the blogger’s username “henry” as the referring blogger:

1. http://WordPressUniversity.org/henry
2. http://WordPressUniversity.org/henry/hello-world (a post)
3. http://WordPressUniversity.org/henry/about (a page)
4. http://www.WordPressUniversity.org/henry
5. http://www.WordPressUniversity.org/henry/hello-world (a post)
6. http://www.WordPressUniversity.org/henry/about (a page)

Or, if the WPMU installation uses subdomains, then the plugin should recognize that “henry” is the referring blogger for these URL’s.

7. http://henry.WordPressUniversity.org (blogger’s home page)
8. http://henry.WordPressUniversity.org/hello-world (a post)
9. http://henry.WordPressUniversity.org/about (a page)

If no referring blogger is entered, then the referring blogger is the system admin.

1. http://WordPressUniversity.org
2. http://www.WordPressUniversity.org

Once the cookie is active, no new cookies are written when switching from all the blogs in the WP Multi-User installation.
During the Registration process, display the referring blogger/afiliate, and give the new visitor the option to manually change the referring affiliate.
Once the new visitor has completed registration, the affiliate cookie is expired.

Leave a Reply

Your email address will not be published. Required fields are marked *