Solved

embedded tracking code/pixel that calls an asp.net script from another website

Posted on 2003-11-06
8
1,113 Views
Last Modified: 2012-06-21
I have an affiliate system setup that when a user clicks on a link a cookie is placed on that user's computer containing the referral's id and click id and then they are redirected to the targeted advertisers page.  Once a transaction has been completed on that advertisers web page I need a way for a script on my website to be called so that i can update that referrer info from a click to a sale.  How can I embed somethign onto a targeted website's page (such as the the thank you page) so that it calls an asp.net (.aspx) script that updates my database without leaving the advertisers webpage.  I know about invisible pixels with php and javascripts and stuff but I can't seem to get it working.  Is there anyone that can come up with some code that can be placed in their thankyou page that calls an asp.net script on my server?  Also, what security measures can be put in place to ensure that it is them that is calling the script.  Thanks!
0
Comment
Question by:adrian78
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 58

Expert Comment

by:amit_g
ID: 9697118
Did you try ...

<script language="JavaScript">
var MyImage = new Image();
MyImage.src = "http://YourSite//YourApplication/YourUpdateFile.aspx";
</script>

In YourUpdateFile.aspx you can do whatever you want to do.
0
 
LVL 33

Expert Comment

by:shalomc
ID: 9699884
adrian78,
The simplest way is to append the affiliate string to the image url, like this:

<img src="http://track.yourdomain.com/shim.asp?freak56" width="1" height="1">

If the affiliate ID is freak56, then the shim.asp script will read QUERY_STRING and redirect the browser to the actiual image.

You can find a transparent 1x1 pixel shim here.
http://genoma.unsam.edu.ar/~fernan/web_safe.html


0
 

Author Comment

by:adrian78
ID: 9704354
Hey there,
That's not what i was trying to do.  I'm trying to be able to run a script on a website from a page on a different website:

example:

Thankyou.htm is displayed on  www.hello.com

I want to be able to place a piece of code/tracking image or something that will be albe to execute the script:

Yourwelcome.aspx?id=34&g=2 on www.goodbye.com

the script Yourwelcome.aspx?id=34&g=2 doesn't actually load anything for display.  It basically reads a cookie and updates the database... but i want to be able to do this without the user being redirected or leaving thankyou.htm on www.hello.com

Thanks!
0
Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

 
LVL 58

Accepted Solution

by:
amit_g earned 500 total points
ID: 9704950
Both ways (Javascript or Image tag) willl call the page from the different domain and thus will execute your script. There is one problem though - since domain are different, you won't be able to read the cookie written by either of them directly. If you want to read the cookie of your domain (where the script is) you will have to do the actual redirection because unless top domain is yours, you will not get any cookie. If you want to read the cookie of the final domain, you will have to read it in javascript and pass it in the query string.
0
 

Author Comment

by:adrian78
ID: 9705119
How do people do it?!  There are lots of companies that do this sort of thing using a script as an image.. and they are able to do the same thing i'm trying to do... any ideas?! Thanks
0
 
LVL 58

Expert Comment

by:amit_g
ID: 9705165
The image (javascript or tag) method will let you call your script from the thanyou page. Pass something in the query string to identify the target site and you know where the request came from.
0
 

Author Comment

by:adrian78
ID: 9705333
that's not exactly what the problem is.  a user clicks a link and a cookie is dropped on their computer (identifying the affiliate that referred them to the advertiser) and they are taken to the advertisers site.  Perhaps a day or so passes and then that user completes a sale on the advertisers site and so that advertisers thankyou.htm page loads up which contains my tracking pixel with the source being the script on my website (sale.php) for example.  The sale.php file gets executed but it can't read the cookie that identifies the affiliate... how can i get around this?!  i know there is a solution because lots of companies do it... i just haven't been able to figure it out.  :|  Thanks in advance!
0
 

Expert Comment

by:ravijp
ID: 10165846
It is very simple.

There are basically 4 entities involved here:

Merchant selling (Merchant)
Affiliate Software Provider (Provider)
Affiliate (affiliate)
Buyer (buyer)

1. When buyer first arrives at affiliate's site, and clicks on affiliate link, the affiliate link contains the affiliate's id, and the link is actually redirected to a script on Provider's site along with the id.

2. => It is the Provider's SCRIPT (at www.provider.com) that reads the affiliate id, adds one "CLICK" to the affiliate's stats, and then SETS A COOKIE on the buyer's computer.

3. The provider's script then redirects user to MERCHANT's site.

4. Merchant's THANK YOU PAGE has a embedded 1x1 pixel img tag, that calls a script on the PROVIDER's web site, again at www.provider.com

5. Since provider.com is the one that "PLACED" the cookie on the BUYER's computer in the first place, the script can also read the same cookie (as they are both on the same domain).

6. Provider.com script reads cookie and updates sale for affiliate.

7. BUYER never left MERCHANT's thankyou page, because all of this happened behind the scenes, thanks to the 1x1 pixel image tag that called the provider's script.

Hope this helps.

Regards,

Ravi Jayagopal
Founder & Software Architect
http://WebmasterInABox.net

0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Returning a value from a class function to a partial view in MVC5 7 60
Understanding UserAgent String 2 66
CSV file copy field 1 to field 2 2 56
calculate days away 11 59
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question