Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2003-11-06
8
Medium Priority
?
1,132 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 58

Accepted Solution

by:
amit_g earned 1000 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

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

610 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