Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 757589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:22:52+00:00 2026-05-14T15:22:52+00:00

how do external counter track unique visitors via image i’d also like to get

  • 0

how do external counter track unique visitors via image
i’d also like to get Referrer if possible.

something like img=”http://www.somecounterdomain.com/count.php?page=83599″

i’m using ASP.NET, c#
i’m aware of a user can “cheat” but would like to make that posibility minimal.
additional difficulty is that i should trach external server and can’t implement c# code there.
what i can is only imlement a counter imag or smth like that.
i try to use generated image.
thx for answers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T15:22:52+00:00Added an answer on May 14, 2026 at 3:22 pm

    Basically what you need to do is the following.

    1- Create either a .ashx or .aspx. Assuming you go with .aspx and call it StatServer.aspx, the Page_Load function will read the query string and write the data to a database, you will see the querystring in step 2. If you want, you can return a image which can be rendered. Some rough code will look something like this.

    private void Page_Load(object sender, EventArgs e)
    {
        WriteQueryStringInformationToDB(Request.QueryString);

    Image image = LoadYourImageHere();
    using (MemoryStream stream = new MemoryStream())
    {
        base.Response.Clear();
        base.Response.ContentType = "image/png";
        image.Save(stream, ImageFormat.Png);
        stream.WriteTo(base.Response.OutputStream);
        base.Response.End();
    }
    

    }

    2- This is the magic, you create a small .js file. In this file you have a function lets call it mystats() which will essentially gather the client side information and make a call to the URL hosting the page you created in step 1. The client side information like screen size, referer etc. is all passed on the querystring. One important thing to include in the function is an ID which indicates which which counter you are updating, that way you can use your counter on multiple sites. A very simple .js might look something like this. (Note tested etc… :))

    function mystats(id)
    {
        // Base URL including the ID of the counter
        var url="http://yourdomainorservername/statserver.aspx?id="+id;

    // Add the referer to the url querystring
    url += "&r=" + escape(document.referrer);
    
    // Add screen width + height
    url += "&w=" + screen.width + "&h=" + screen.height;
    
    document.write('<img src="'+url+'" border=0 alt="Site statistics">');
    

    }

    3- On the web pages that you want to apply the counter, you add a script block that includes the the .js file from your server and calls the mystats function from an img tag, this causes the js code to collect the info and send a request to your server, which in turn updates the DB and returns the image stream to display.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an external library with some code in it. I also have a
In Google App Engine free 1GB bandwidth hosting website if we have external image
On external website (not fb page) would like to put like button where once
Generally I would go about this by placing something(s) unique and random in the
This question might seem like a repeat, but I really couldn't find something similar.
I am loading an external page in an iFrame that redirects after a counter.
I am trying to get variables from an external domain using ajax and then
external CSS and inline SVG in a HTML5-document are really giving me a hard
I have an external distance object ( gdis ) and need to convert it
I have an external javascript library which triggers on the change of a textarea,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.