![]() |
Need help with displaying Affiliate name on screen |
Post Reply ![]() |
Author | |
Andy @ Landmarq ![]() Newbie ![]() ![]() Joined: 12-November-2008 Location: London Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() Posted: 02-April-2009 at 8:55am |
Afternoon fellow 'carters
I am trying to set up a site for use with the affiliate feature but I want the Affilate company name to display when an affilate link is clicked. The idea being if someone just arrives on out site it's says one message but if it's an affiliate link it will add their name to the end. I have been using the code below which is a modified version of how I display a logged in customers name on the screen on my main site but having trouble pinning down the fields needed for this to work. <% if session("IDAffiliate")<>"0" then %> <% response.write "<h2> In partnership with Landmarq Technologies Limited & " & session("pcSFCompany") & "</h2>" %> <% else %> <% response.write "<h2> In partnership with Landmarq Technologies Limited</h2>" %> <% end if %> The IDAffiliate should be able to pick which affiliate is being used and then the company name gets displayed but I cannot get the company name to display or get it to properly detect the difference between a regular vist and an affiliate vist. Any help on this would be great I'm pretty sure im on the right track but it's the fields tat need tweaking. Thanks in advance for any replies :) |
|
Need a bespoke PC built to order? come to www.landmarq.co.uk
|
|
![]() |
|
Hamish ![]() Admin Group ![]() Joined: 12-October-2006 Location: United Kingdom Status: Offline Points: 56 |
![]() ![]() ![]() ![]() ![]() |
Hi Andy,
You will need to get the "affiliatecompany" from the "affiliates" table of the database with some SQL. See NewAffa.asp for the code that inserts it in the table. |
|
![]() |
|
Andy @ Landmarq ![]() Newbie ![]() ![]() Joined: 12-November-2008 Location: London Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
Hi Hamish,
Thanks for the pointers :) I thought I might but did not have much luck intially will give it another whirl, I was using newaffa.asp as a reference point to get the table names. |
|
Need a bespoke PC built to order? come to www.landmarq.co.uk
|
|
![]() |
|
Andy @ Landmarq ![]() Newbie ![]() ![]() Joined: 12-November-2008 Location: London Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
Being the SQL thickie that I am I have got to this, I am manually using affiliate 2 as it's a test one but I will need to find how to detect which idaffiliate is being used on the link I guess I'm still missing something as the IF statement shows the first line but the company is not being shown. Any more pointers to get me on track would be great :)
<!--#include virtual="shop/includes/opendb.asp"--> <% call openDB() query="SELECT idaffiliate, affiliatecompany FROM affiliates WHERE idaffiliate=2" set rstemp=conntemp.execute(query) session("affid")=rstemp("idAffiliate") Session("affcomp")=rstemp("affilatecompany") %> <div id="logo"> <h1><img src=images2/shutlogo.png></h1> <% if session("affid")<>"0" then %> <% response.write "<h2> In partnership with Landmarq Technologies Limited & " & session("affcomp") & "</h2>" %> <% else %> <% response.write "<h2> In partnership with Landmarq Technologies Limited</h2>" %> <% end if %> </div> Edited by Andy @ Landmarq - 02-April-2009 at 11:45am |
|
Need a bespoke PC built to order? come to www.landmarq.co.uk
|
|
![]() |
|
RUOnTheNet ![]() Newbie ![]() Joined: 06-November-2008 Location: Vancouver Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
My suggestion is
You need to retrieve the Aff ID from the cookie on the visitor's site if product cart uses a cookie for tracking affiliates. ( we use a third party aff program, but asp based and that is how we do this. )
What you need to do is get the Aff ID from the cookie, then have it passed to your page as a string etc. ... so the idaffiliate="string_COOKIE" ..
|
|
Alan,
www.AreYouOnTheNet.com Internet Sales, Marketing & Affiliate Program Management |
|
![]() |
|
Hamish ![]() Admin Group ![]() Joined: 12-October-2006 Location: United Kingdom Status: Offline Points: 56 |
![]() ![]() ![]() ![]() ![]() |
Hi,
ProductCart automatically retrieves the affiliateid if there is one stored in the cookie in code within pc/pcStartSession.asp so you should be able to access it just about everywhere with: session("idAffiliate") - basically combine your two posts. You should also exclude affiliateid=1 |
|
![]() |
|
Andy @ Landmarq ![]() Newbie ![]() ![]() Joined: 12-November-2008 Location: London Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
I solved it
![]() ![]() I was not winning with the whole sql query thing (need to learn more on that front) but had a flash on inspiration that allows me a touch more flexability albeit with a touch more work. In my header I now have <% if session("idAffiliate")>1 then %> <% Server.Execute("aff/"&session("idAffiliate")&".asp") %> <% else %> <% response.write "<h2> </h2>" %> <% end if %> (on the line with you can have a message shown when there is no affiliate set) Then in my subdir aff/ i have files simply named 2.asp, 3.asp etc . . . which might contain <% response.write "<h2>In partnership with XYZ Computers</h2>" %> or <% response.write "<h2><span style=""vertical-align: bottom;"">In partnership with <img style=""vertical-align: bottom;"" src=images/login.gif></span></h2>" %> So when an affilate link is parsed the idaffilate becomes the filename and can display either a simple line of text or text/image or anything I fancy in the called .asp file. It work just fine and save a lot of extra database calls on every page load. If anyone wants to use this code please feel free to help yourself ![]() |
|
Need a bespoke PC built to order? come to www.landmarq.co.uk
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |