Problem Solved; Tracking affiliate codes from one domain to another
(This is a true story about a real problem that was solved
with current and readily available technology.)
This story is about two domains.
One domain publishes ebooks. Authors with real-world
experience are published here. You can buy ebooks. And you
can become an affiliate to sell ebooks.
The domain has good products and it treats its affiliates
well and it flourishes. The domain is Intellectua.com.
The second domain is DreamJobsToGo.com. It publishes ebooks
too, by authors who write from experience. Sales of
DreamJobsToGo.com's line of ebooks are processed at
Intellectua.com.
Instead of instituting its own affiliate program,
DreamJobsToGo.com wants to pay product sales commissions
to already established Intellectua.com affiliates who send
prospects to DreamJobsToGo.com.
(Disclosure: Intellectua.com publishes some of my ebooks.)
This is the problem: Affiliate codes need to be tracked
from DreamJobsToGo.com to Intellectua.com so commissions
can be paid.
Affiliate codes, in this case, are 5-digits in length and
need to be in the correct position within the URL. The
affiliate code tells Intellectua.com's CGI shopping cart
and affiliate programs who to credit for the sale.
So when a surfer clicks on an affiliate's link leading to
DreamJobsToGo.com, the affiliate code is recorded and kept
track of. If the surfer decides to buy, s/he is sent to
Intellectua.com with a URL that includes the affiliate code.
The first step to solving the problem is to specify that
affiliate links leading to DreamJobsToGo.com must have a
question mark and the affiliate code as the last characters
of the URL. The URL can be http://DreamJobsToGo.com?10033
or http://DreamJobsToGo.com/authors/index.html?10033 or any
other page within the DreamJobsToGo.com site -- so long as
a question mark and the affiliate code are the last
characters of the URL.
JavaScript code scans the DreamJobsToGo.com URL and extracts
any affiliate code it might contain. If the URL contains no
affiliate code, a generic code is substituted.
The "question mark and affiliate code as the last characters
of the URL" specification for DreamJobsToGo.com is necessary
for extracting the affiliate code from the end of the URL.
The JavaScript looks for the question mark and, if it's
there, anything following the question mark is the
affiliate code.
The next step is the recording and tracking part. When an
affiliate code is extracted from a DreamJobsToGo.com URL,
that code is stored in a cookie on the prospect's computer.
That way, the prospect can move about anywhere on the
DreamJobsToGo.com site and the cookie remembers
the affiliate code.
Cookies set by one domain may not be read by another domain.
Therefore, a different mechanism is used to transfer the
affiliate code from DreamJobsToGo.com to Intellectua.com.
The CGI shopping cart and affiliate software at
Intellectua.com have their own URL specifications; they
each expect to find certain information in certain places
along the URL.
Here is an example of the Intellectua.com URL for
purchasing Dana K. Cassell's "Freelance Writer" ebook:
http://Intellectua.com/cgi-bin/sgx/store/web_store.cgi?page=djtg0001.html&afnum=10033
Of all the information in that URL, we're concerned only
with the affiliate code. Notice that the affiliate code
is at the end of the URL following the characters: afnum=
When a prospect visits a product page at DreamJobsToGo.com,
Dana K. Cassell's "Freelance Writer" ebook, for example,
then the purchasing link leading to Intellectua.com must
be custom created on the fly to include the affiliate code.
Without the affiliate code, the affiliate can't get paid.
The link leading to Intellectua.com is custom created with
JavaScript.
First, the JavaScript reads the cookie on the prospect's
computer. (Note that the prospect is still at
DreamJobsToGo.com, which means the cookie can be read.)
Then, the JavaScript creates the custom purchasing link
and inserts it at the proper place on the DreamJobsToGo.com
product page. In this way the affiliate code is sent to the
Intellectua.com site for the payment process.
It works like a charm.
When an Intellectua.com affiliate sends prospects to
DreamJobsToGo.com with the affiliate's code, the code is
kept track of. If the prospect buys a DreamJobsToGo.com
product, the affiliate is paid a commission.
Problem solved.
Question:
Did you find this article interesting and understandable? How can it be improved?
Your response is anonymous.
When done typing, click anywhere outside the box. [more info]
Will Bontrager
©2001 Bontrager Connection, LLC
Please note:
Articles on this website are presented "as is". However -
If you have a question about a CGI script, HTML, CSS, PHP, or JavaScript
Ask one of our Experts and you'll have your answer!
Click here for details.