How to Implement Landing Page Hit Tracking in ASP.NET (Part 4)
- by Scott Whigham on January 23, 2009 10:50 AMIn Part 1 we talked about the goals of the project and the two base tables. In Part 2 we talked about the LandingPageHit table. Part 3 covered the classes, LandingPage and WebsiteUtilities.
In Part 4 of this long series about how to do conversion tracking with ASP.NET and SQL Server, we'll wire it all up and show you how to track users. So far, here's what we've done:
Just to make sure you're still with me, here's what we've done so far:
- Step 1: Create a new SQL Server database. Execute the commands below in that database
- Step 2: Create/open website project and add references
- Step 3: Create a test page
- Step 4: Create the LandingPageHit table and supporting objects
- Step 5: Create the LandingPage class
- Step 6: Create the WebsiteUtilities class
Step 7: Add our tracking to our pages!
Add the following to your .aspx test page that you created in Step 3:
protected void Page_Load(object sender, EventArgs e)
{
WebsiteUtilities.SetLandingPageHitCookie(Request);
}
Now go browse to that page...
Next, log into your SQL Server and run the following queries:
SELECT * FROM dbo.LandingPage
SELECT * FROM dbo.LandingPageHit
Do you see your hit? Awesome! Go browse to that page again - hit refresh a few times even - and then come back and re-run the queries.
- Are there more rows than there were before? (there shouldn't be - the cookie stored the LandingPageHitId and then, because it exists already, it doesn't re-audit the hit)
Now, go browse to that page using a different browser (or from a different computer). Re-run your queries - now you should still see only one LandingPage but you should now have two rows in the LandingPageHit table!
Step 8 (Final step): Add the code into your registration routine to associate a LandingPageHitId with a UserId
Our final step is to modify your registration routine so that, after you have added your User to the "Users" table and returned your UserId, you can associate the LandingPageHitId with that UserId. We do it like this:
// Your code to add a user and return the UserId goes here
var tracker = new LandingPage();
string landingPageHitId = WebsiteUtilities.GetLandingPageHitId(Request);
if (!String.IsNullOrEmpty(landingPageHitId))
tracker.AssociateSubscriberWithLandingPage(subscriberId, new Guid(landingPageHitId),
WebsiteUtilities.ConnectionString);
// Your code to redirect your user after login goes here
And that's it - once you implement this code, you can do conversion tracking with SQL and ASP.NET. You can write reports that trace users to specific landing pages and find out which of your pages convert the best.
A Few Words on Security
Do yourself a favor - don't just blindly insert the code that I've posted into your website. There are lots of bad things that could happen if you don't protect yourself. There are lots of things that I have in my production code that I didn't post here (for the sake of brevity) - things like:
- SQL Injection
- Cookie stealing
- XSS
- Limiting cookies to this domain only
- String sanitization
- Encryption
- Url encoding and decoding
And so much more... This post is about How to Audit Users on a Website using ASP.NET and SQL Server - it's not about every little possible thing.




Merely want to say your article is stunning. The clearness in your post is simply spectacular and i can take for granted you are an expert on this subject. Well with your permission allow me to grab your rss feed to keep up to date with incoming post. Thanks a million and please keep up the strong work.
I am relieved to find out that there is actually a little good content left on the internet. I've gotten so fed up with google delivering me garbage.
Twitter are a MUST for webmasters!
If the economy turns up, the government stands to gain due to increased tax revenues. The people can figure on another seven years of famine, though.
Great Post. I would love to read more in future. keep up the good work. Yearly hosting http://www.intelweb.biz
British TV Abroad: http://www.vpn-privacy.org/index.php?main_page=index&cPath=10
loved most posts in your blog,still cant tell what to buy? online viagra brand or generic...
Could it be possible if I link up to this blog, from my webpage? I'm wanting to gather as many pieces of good information as I can.
I really like this site and How to Implement Landing Page Hit Tracking in ASP.NET (Part 4) | TechUrbia - A LearnItFirst Blog . I read about you on another site I found on Ask and thought they had great views as well.
i thought so but i will and see if others think the same
Excellent blog you have there, thanks for sharing, iv bookmakred you!
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well and i have start my own blog now, it's about to domain name , thanks for your effort
WOw I like the site this kind of stuff is right up my alley!
For making a online purchase the first thing you should check is that whether the drugs sold by them are approved by the Food and Drug Administration or not. And they all are approved at www.drugstoregenerics.com . Once you are the satisfied with all these details then only make the purchase from www.drugstoregenerics.com. So, to save the money and time go for www.drugstoregenerics.com.
Who knew something could be so tremendous especially when compared to long term insurance.
http://www.aaronmacleod.co.uk/post/c-sharp-For-Begginers.aspx
Online pharmacies are easiest way to buy the drugs. The best thing about the online pharmacies is that they sell the drugs at the affordable rates, which suits customer the most. Another important advantage of the online pharmacies is that you get the medicine without anyone knows about it. In fact I would say online pharmacy www.drugstoregenerics.com is the best place to buy the medicines related to the sexual health ailments. The trend of online pharmacy is ruling the drugs market today because of the additional benefits it is providing to the customers.
Great article . Will definitely copy it to my site.Thanks.
I thoroughly enjoy doing my bodybuilding exercise in the morning . It gives me energy throughout the day. If my workouts were highly intense, I feel great all day long. Supplements are not really necessary with the proper bodybuilding exercise , really good nutrition program and the proper rest.
Maybe that's their thought of? heaven
Most insurance companies’ websites are secure. It’s the local or small insurance co that dont have secure websites and bind coverage for small periods of time. As far as online quotes are concerned if you dont provide a VIN # at the time of quoting, the quote is pretty much a "ball park" figure. Without the VIN, the quote will rate the vehicle as far as statistics are concerned and you as the principal operator. Of course there are MANY factors that come into play when rating is taken into consideration on an auto policy.
Bigger Biceps And A Fantastic Body! It Is All Within Your Grasp! This Easy To Read Information and Advice On Bodybuilding Can Make It Happen.
Thank you for a great post
In fact, some of the Swiss luxury watch, in appearance and identity numbers are there, and done a lot of anti-counterfeiting
measures,. For example, Rolex has 5 numbers, they are: (1) case models, (2) Watch production sequence number
movement and on the number, (4) the movement and on the production sequence number, (5) the band number. In addition to the
band number in the band discount out surface, the rest are hidden, not to remove the watch strap or open the rear door in order to
see it.
Wonderful to read!
I would like to thank you for the effort you have made in publishing this article. I am trusting the same best work from you in the future as well
Excellent job.
Good post, thanks
Super site, and niec text.
With so several weight lifting programs accessible it was very tough to pick the correct 1 for me. Once I found one that got me results I stuck with it and I simply modify it occasionally.
Rafael Brosi
Farrah Jacaruso
http://ezinearticles.com/?Dentist---What-Does-He-Do?&id=4282701 important to visit the dentist
I’m not actually too familiar with this topic. I a bit more so just like to stop by blogs for layout tips and points like that. But you in fact developed a subest that i often care absolutely nothing about exceptionally intriguing. This can be a very good blog to design mine immediately after. I hope you do not mind if i bookmark your websites, in order that i can effortlessly get it once more within the future. Cheers.
genericpharmacia.com provide the customers with the drugs at the lowest possible costs because they do not have to spend too much on maintaining the physical shop and on hiring the person who will handle the shop. Very less maintenance and rental is required for the online drugs stores so additional savings are done here. Also, www.drugstoregenerics.com purchase the medicines directly from the drug manufacturer so they get the drugs at very less costs and the drug wholesaler doesn’t come in between. This helps the online pharmacies to keep the prices of the drugs at comparatively lower rates than the shopkeepers.
For making a online purchase the first thing you should check is that whether the drugs sold by them are approved by the Food and Drug Administration or not. And they all are approved at www.drugstoregenerics.com . Once you are the satisfied with all these details then only make the purchase from www.drugstoregenerics.com. So, to save the money and time go for www.drugstoregenerics.com.
For making a online purchase the first thing you should check is that whether the drugs sold by them are approved by the Food and Drug Administration or not. And they all are approved at www.drugstoregenerics.com . Once you are the satisfied with all these details then only make the purchase from www.drugstoregenerics.com. So, to save the money and time go for www.drugstoregenerics.com.
For making a online purchase the first thing you should check is that whether the drugs sold by them are approved by the Food and Drug Administration or not. And they all are approved at www.drugstoregenerics.com . Once you are the satisfied with all these details then only make the purchase from www.drugstoregenerics.com. So, to save the money and time go for www.drugstoregenerics.com.
genericpharmacia.com provide the customers with the drugs at the lowest possible costs because they do not have to spend too much on maintaining the physical shop and on hiring the person who will handle the shop. Very less maintenance and rental is required for the online drugs stores so additional savings are done here. Also, www.drugstoregenerics.com purchase the medicines directly from the drug manufacturer so they get the drugs at very less costs and the drug wholesaler doesn’t come in between. This helps the online pharmacies to keep the prices of the drugs at comparatively lower rates than the shopkeepers.
This is really a nice article thank you so much.
Online pharmacies are easiest way to buy the drugs. The best thing about the online pharmacies is that they sell the drugs at the affordable rates, which suits customer the most. Another important advantage of the online pharmacies is that you get the medicine without anyone knows about it. In fact I would say online pharmacy www.drugstoregenerics.com is the best place to buy the medicines related to the sexual health ailments. The trend of online pharmacy is ruling the drugs market today because of the additional benefits it is providing to the customers.
Online pharmacies are easiest way to buy the drugs. The best thing about the online pharmacies is that they sell the drugs at the affordable rates, which suits customer the most. Another important advantage of the online pharmacies is that you get the medicine without anyone knows about it. In fact I would say online pharmacy www.drugstoregenerics.com is the best place to buy the medicines related to the sexual health ailments. The trend of online pharmacy is ruling the drugs market today because of the additional benefits it is providing to the customers.
For making a online purchase the first thing you should check is that whether the drugs sold by them are approved by the Food and Drug Administration or not. And they all are approved at www.drugstoregenerics.com . Once you are the satisfied with all these details then only make the purchase from www.drugstoregenerics.com. So, to save the money and time go for www.drugstoregenerics.com.
For making a online purchase the first thing you should check is that whether the drugs sold by them are approved by the Food and Drug Administration or not. And they all are approved at www.drugstoregenerics.com . Once you are the satisfied with all these details then only make the purchase from www.drugstoregenerics.com. So, to save the money and time go for www.drugstoregenerics.com.
genericpharmacia.com provide the customers with the drugs at the lowest possible costs because they do not have to spend too much on maintaining the physical shop and on hiring the person who will handle the shop. Very less maintenance and rental is required for the online drugs stores so additional savings are done here. Also, www.drugstoregenerics.com purchase the medicines directly from the drug manufacturer so they get the drugs at very less costs and the drug wholesaler doesn’t come in between. This helps the online pharmacies to keep the prices of the drugs at comparatively lower rates than the shopkeepers.
genericpharmacia.com provide the customers with the drugs at the lowest possible costs because they do not have to spend too much on maintaining the physical shop and on hiring the person who will handle the shop. Very less maintenance and rental is required for the online drugs stores so additional savings are done here. Also, www.drugstoregenerics.com purchase the medicines directly from the drug manufacturer so they get the drugs at very less costs and the drug wholesaler doesn’t come in between. This helps the online pharmacies to keep the prices of the drugs at comparatively lower rates than the shopkeepers.
This page was not working this morning. i tried viewing it but it timed out 4-5 times now but i can access it now. Why does this occur? Am i the only one having this problem?
In www.drugstoregenerics.com, the products are showcased in a friendly way so that customer can easily pick up what he needs. Medicines are often accompanied by proper literature about ingredients, how to use, doses, how to store, and all other important information. www.drugstoregenerics.com is one that gives adequate information to the customer about the medicine he/she is going to buy. Online pharmacies also provide you the case studies and research studies conducted on the drugs and whatever were it results.
In www.drugstoregenerics.com, the products are showcased in a friendly way so that customer can easily pick up what he needs. Medicines are often accompanied by proper literature about ingredients, how to use, doses, how to store, and all other important information. www.drugstoregenerics.com is one that gives adequate information to the customer about the medicine he/she is going to buy. Online pharmacies also provide you the case studies and research studies conducted on the drugs and whatever were it results.
In www.drugstoregenerics.com, the products are showcased in a friendly way so that customer can easily pick up what he needs. Medicines are often accompanied by proper literature about ingredients, how to use, doses, how to store, and all other important information. www.drugstoregenerics.com is one that gives adequate information to the customer about the medicine he/she is going to buy. Online pharmacies also provide you the case studies and research studies conducted on the drugs and whatever were it results.
In www.drugstoregenerics.com, the products are showcased in a friendly way so that customer can easily pick up what he needs. Medicines are often accompanied by proper literature about ingredients, how to use, doses, how to store, and all other important information. www.drugstoregenerics.com is one that gives adequate information to the customer about the medicine he/she is going to buy. Online pharmacies also provide you the case studies and research studies conducted on the drugs and whatever were it results.
genericpharmacia.com provide the customers with the drugs at the lowest possible costs because they do not have to spend too much on maintaining the physical shop and on hiring the person who will handle the shop. Very less maintenance and rental is required for the online drugs stores so additional savings are done here. Also, www.drugstoregenerics.com purchase the medicines directly from the drug manufacturer so they get the drugs at very less costs and the drug wholesaler doesn’t come in between. This helps the online pharmacies to keep the prices of the drugs at comparatively lower rates than the shopkeepers.
It’s the first time I have heard that in Macedonia, obits are an unusual observe.
genericpharmacia.com provide the customers with the drugs at the lowest possible costs because they do not have to spend too much on maintaining the physical shop and on hiring the person who will handle the shop. Very less maintenance and rental is required for the online drugs stores so additional savings are done here. Also, www.drugstoregenerics.com purchase the medicines directly from the drug manufacturer so they get the drugs at very less costs and the drug wholesaler doesn’t come in between. This helps the online pharmacies to keep the prices of the drugs at comparatively lower rates than the shopkeepers.
For making a online purchase the first thing you should check is that whether the drugs sold by them are approved by the Food and Drug Administration or not. And they all are approved at www.drugstoregenerics.com . Once you are the satisfied with all these details then only make the purchase from www.drugstoregenerics.com. So, to save the money and time go for www.drugstoregenerics.com.
Hey ...cheers for the very informative post .I'm really happy I found it on yahooKeep up the great work because I for sure will check it out for updates
Hey, interesting article. We are adamant supporters of naturally raising testosterone - our health is too important to destroy it with synthetics... so we promote new supplements from Mother Nature. Anyway... thanks again and slick site - I'm subscribed to your feed now so I'll check in more often!
woopwoop nieuwe badpakken gehaalt, toch wel leuker als je 4 maten kwijt bent :D nog steeds ziek helaaz :(
your blog’s design is simple and clean and i like it. Your blog posts are superb.
My Money is on Argentina Winning this year….I think Messi is really going to step up….He is the best player in the world…..and i know many people think other wise,and it would be interesting to who you folks think is the best player
Looks quite Facebook-centered to me. At any time you do not possess a Facebook Account, there is practically nothing surely to find out on that web page. Also, after 3 days, you may have to pay-up to remain a premium member. Not extremely TPB design, at any time you ask me. If you have time.Please enter my blog online penpalssite
I’ve been visiting your blog for a while now and I always find a gem in your new posts. Thanks for sharing.
Awesome Blog. I add this Post to my bookmarks.
Thanks for sharing this pretty post.
It's an okay product. I notice that I gained more energy. But what sucks is, one night I forgot to take the pills & the next morning, I felt like I had a blast! I felt like I had stomach ache, cramps, diarrhea, whatever. But everytime I go in the bathroom, nothing comes out!!! So, right after I took the pills, I was feeling alright again.
I just sent this post to a bunch of my friends as I agree with most of what you’re saying here and the way you’ve presented it is awesome.
very nice post liked it. keep it up :)
keep updatin us with lot of these shares
Thanks for sharing dude :)
very nice and informative...
very nice post liked it. keep it up :)
I just sent this post to a bunch of my friends as I agree with most of what you’re saying here and the way you’ve presented it is awesome.
I’ve been visiting your blog for a while now and I always find a gem in your new posts. Thanks for sharing.
I’ve been visiting your blog for a while now and I always find a gem in your new posts. Thanks for sharing.
You certainly have some agreeable opinions and views. Your blog provides a fresh look at the subject.
Awesome Post. I add this Blog to my bookmarks.
I just sent this post to a bunch of my friends as I agree with most of what you’re saying here and the way you’ve presented it is awesome.
Lets try to save our planet and live green. If we all do a little bit we can help preseve the earth.
Should I buy steel golf clubs or graphite ?
I just book marked your blog on Digg and StumbleUpon.I enjoy reading your commentaries.
OK nice to see- interesting comments are always helpful!
Truly attention grabbing information. Is it ok if I linked to your site from my site? Search
Which golf clubs will be the best for beginner ?
Should I buy steel golf clubs or graphite ?
You certainly deserve a round of applause for your post and more specifically, your blog in general. Very high quality material.
I find myself coming to your blog more and more often to the point where my visits are almost daily now!
Very informative post. Thanks for taking the time to share your view with us.
I’ve been visiting your blog for a while now and I always find a gem in your new posts. Thanks for sharing.
Can't live without this product. I notice a huge difference in my mindset, digestive system and energy level when I stop taking ACAI and with this product in particular, I notice the highest degree of potency and it seems to work quicker than others too. LOVE IT!
Can't live without this product. I notice a huge difference in my mindset, digestive system and energy level when I stop taking ACAI and with this product in particular, I notice the highest degree of potency and it seems to work quicker than others too. LOVE IT!
Im not one for fad diet supplements - but I tried this anyways. Firt off, it's no miracle diet pill. There's no such thing. But, if you use this in conjunction with smart eating habits and some form of daily exercise - you will see results. I just finished my first round and I have lost 10 lbs. in about 3 weeks. I used the supplement with a modified Special K cereal diet as well as 30-60 mins a day Dance Dance Revolution cardio (I found that DDR is the best low impact cardio that I don't get bored with.) The product is very mild on your system, there's no discomfort that I was aware of. It curbed my appetite, upped my energy so I was actually motivated to workout when I got home from work instead of crashing on the couch and some of the little bonuses I noted from using this product were that my skin has been clearer and I am also sleeping better. I'm so pleased with the results so far, I am already ordering another.
Great post!
You certainly have some agreeable opinions and views. Your blog provides a fresh look at the subject.
Thank You For This Post, was added to my bookmarks.
Many people still has a question whether it is secure to buy medicines online? Yes, it is absolutely safe to buy medicines online because offshoremedicinepharmacy.com understands the value of the hard-earned money of the customer and thus follow the latest security measures while the money transaction takes place. Online pharmacies also sometimes have a registered physician who guides you through and suggests the medicines you can buy. You just have to switch on your computer and fill the questionnaire regarding the symptoms and according to your descriptions you will be directed to purchase medicines that suites you best. Online pharmacies are a decade old but they have revolutionized the pharmacy market.http://www.viagra-stop.com
I bought this product with the idea of losing some weight. When I first tried this product combination, I did not notice much of a change, but over the weeks the difference was noticeable. I notice this product and a little exercise a week makes great results!
Im not one for fad diet supplements - but I tried this anyways. Firt off, it's no miracle diet pill. There's no such thing. But, if you use this in conjunction with smart eating habits and some form of daily exercise - you will see results. I just finished my first round and I have lost 10 lbs. in about 3 weeks. I used the supplement with a modified Special K cereal diet as well as 30-60 mins a day Dance Dance Revolution cardio (I found that DDR is the best low impact cardio that I don't get bored with.) The product is very mild on your system, there's no discomfort that I was aware of. It curbed my appetite, upped my energy so I was actually motivated to workout when I got home from work instead of crashing on the couch and some of the little bonuses I noted from using this product were that my skin has been clearer and I am also sleeping better. I'm so pleased with the results so far, I am already ordering another.
Used it for a week so far and all I can say wow. The appetite is the first thing I have noticed. After few days you can feel you have more energy and you are not tired through the day. I would be hungry all the time before I was using this and I could not get low body fat with 3 to 5 days at the gym because of my calorie intake. With this it should not be a problem. At this price you can't say its not worth trying. I also take a multivitamin and Omega 3.
all i have to say is wow. it worked for me. maybe the people upset with this product didn't really use it properly. maybe they skipped out of a little bit of exercise. it worked for me and that's all i have to say about it. now im going to get my ACUs in a smaller size as they seem a bit large for me now.thanks for your product.
I was hopeful and not looking for a miracle pill, I just wanted it to do at least part of what it claimed to do. The colon cleanse is a joke. It serves NO purpose, and has not made any difference. The Acia berry doesn't do anything at all for hunger and it makes me jittery which causes me to feel nauseous which causes me to feel sleepy. I haven't even had the energy I usually have to exercise. I took it for 10 days. I'm stopping as of now so I can have some energy again. I'm sorry I wasted my money. Please don't waste yours.
Can't live without this product. I notice a huge difference in my mindset, digestive system and energy level when I stop taking ACAI and with this product in particular, I notice the highest degree of potency and it seems to work quicker than others too. LOVE IT!
Haha Ive ordered it and noticed quite a big change in energy use to I could only run a mile now I can run 2 miles and still want to run more...and thats after 3 days of taking it....As for the guy that says look at all the 5 star ratings they only have 1 review so do 4 of the 5 1 star rating also hah! so it would seem that other companies are making accounts and reviewing this item so they can sell theres instead....hah this review buisness all seems like crap to me...hah but either way I took it and love it:) havent even had it a week and ive felt more motivated than ever...im 19 and almost bald hah! funny stuff huh well my hair is starting to grow back already also..*no joke*;) anyways all these reviews are hard to believe is my point so really the only thing you can do is try it yourself and dont judge it by reviews cause reviews= fail in this case
really. could be more responsible. medicines tell us. your blood pumping. good if our entire. find out.
I truly appreciate you taking the time to post this. I really liked reading it and am looking forward to more posts from you! Keep 'em coming.
Been lookin for some useful information for the past hour thanks for this!
Great articles and content very informative looking forward to reading more.
Thanks for the post, good stuff!