in my asp.net form i want to show country flag along with current visitor count. when user visit our site from USA then USA flag count will be increase by one and when the same user close his browser or go to another site then count will be decrease. please give me the best logic to show current visitor count country wise along with country flag. need help. thanks
The biggest problem here is this - you can't rely on the event of closing the browser.
http://www.codeproject.com/Articles/58835/Window-Close-Event-of-Browser
However, you can try to get at least approximate results. In the article above you see how to react on these events. I'd use ajax to communicate with the server to increment/decrement the values as needed, updating the relevant parts of the page in the process. For storage, you can use database to store these values for instance.
Look here for more info on ajax with jquery in asp.net: http://www.simple-talk.com/dotnet/asp.net/ajax-basics-with-jquery-in-asp.net/ If it isn't enough for you, use google, there are plenty resources out there waiting for you.
Related
Can I save the place ID from Here Places API, for an indefinite period of time? I tried searching the policy, but coudn't able to find the solution. We will appreciate your help.
Places data is subjected to change whenever any details of the place is modified(like website, location, phone number etc.) So there is no fool-proof way to rely on the old api output for an indefinite period of time.
Lets say I wish to track
User action - game he played - which area he stays - his house number.
If I were to track these event actions in Tabular format, it would look like:
UserId|Game|Area|House|Timestamp so on.
Then I can always run SQL queries if I want to answer few business queries. Like
1. In a given day/week, who is the most active User
2. Which game is most-played?
3. Which area plays most events
4. Which user from which area are the most active
Whats the best way to capture this using Google analytics? Will custom dimensions be useful. Or GA is not suitable for this kind of insight?
Thanks.
First of all, the house number is too precise, it would be against GA's ToS.
In GA everything is captured in "hits", you can think of this as one "row" of data.
Let's look at what you wanted to find out:
Most Active User? - This depends on how you determine "Active". Is it the longest Session durations? Tried most games? Most logins? Most sessions? To track a user, you'd need a User ID tracked.
Which game is played the most? - Again, what is played the most? Longest time in game? Most "start" games? This would require you to know the Game that was played and when someone started playing
Which area is most active? -This would go back to the definition of active, the region information is needed along with the active definition
Which users are most active in an area? Same as above, the user would need to be identified and area
To determine which Custom Dimensions (CDs) you want, let's look at the example data points you want to track and try to determine the scope and if it already exists as a standard dimension:
User ID - this is obviously related to the user, makes sense to be user-scoped
Game - This is a tougher CD. I would think that in a single session, users can play multiple games, thus I'd think you'd want this to be hit-scoped.
Area - GA already provides this based on the ISP
Timestamp - GA already provides time dimensions
From above, we can determine that you need to create two CDs, one to track User ID, the other to track the Game.
You can also look into using the userid feature in GA for cross-device tracking.
Say I have two pages on a site called “Page 1” and “Page 10”. I'd like to be able to see the paths visitors take to get from “Page 1” to “Page 10” with full URLs intact. Many of the URLs (including those for “Page 1” and “Page 10”) will include query strings that are important.
Is this possible? If so, how?
Try using behavior flow reports. The report basically shows you how visitors click through your website. There are a lot of ways to customize the report, with which you will need to play around to really answer your question. By default, the behavior flow focuses on entry and exit points of visitors, regardless how many times they hit the different subpages in between. However, I'm sure you can set appropriate filters and settings to answer your question.
I use two methods for tracking where people have been on my website:
Track and store the information in my own SQL database. (details below)
Lead Forensics (paid subscription, but you can do a trial).
For tracking and storing my own data, I record unique visitors based upon the IP Address they're connecting from and then have a separate table that records all page views that links back to the unique visitor table.
Lead Forensics data simply allows me to link up those unique visitors with actual companies that have viewed my website.
Doing it yourself means you don't have to rely on Google working for your records to work, and in my experience Google Analytics tends to round numbers so you don't get a true indication of numbers, and also you can remove bots and website trawlers from your data by tracking the user agent string.
As a somewhat ugly hack you could use transaction tracking. If you use the same transaction id multiple times subsequent products will be added to the existing data. So assign an ID at the start of the visits and on each page record a transaction with the current page url as product name (and the ID as transaction id). This will give you the complete path per user (I am frankly not to sure how this is useful - at some point you probably want aggregated data. Plus each transaction and product counts towards your quota for interaction counts, so on a large site you might run over the 10mio hits limit).
you can do it programatically
have a MAP in the backend which stores the userId (assuming u would have given a unique ID at the time of login to each user) with a list of Strings(each string being URL visited by that user)
whenever the user hits another URL from Page 1(and only from page1, check it using JS), send a POST request to backend with the new URL in its data section.
In the backend, check if the URL is of Page 10 and if not, add this URL as a string into the MAP for that corresponding user
Finally, when the user clicks on the Page 10 URL, you know the URLs in the way from Page 1 to Page 10 and so use them.
Though if I consider JS and I have not misunderstood your question, we can get the previous URL from request header information using document.referrer.
Are you trying to do it from 'Google Tag Manager'? I am not sure whether you are trying to trace the URLS in clientside or server side?
I have a website that allows people to create an account (that is the conversion I wish to track).
I wish to know where a specific person is coming from. I have google analytics installed and have set up the registration page as a goal, but the reporting tells me traffic sources as an aggregated pie chart. It doesn't report down to the user account level to say that 'person with email xyz' came from 'facebook' for example.
What custom variables or mark up would I need to add to GA to report at that detailed level, if that is at all possible?
Otherwise, I will just have to record the first http_referer in a cookie and stick it in a database during the registration process.
Any advice?
Firstly I must ask you, how actionable do you think it is to look at data at that granular of a level? Finding out what % of people who registered came from facebook or some other place is actionable, because it helps you do things like determine where to focus marketing efforts. But individual users? How is this actionable to you? (hint: it's not)
However, if you are still determined to know this, you should first note that it is against Google's ToS to record personally identifiable data both directly (recording the actual value in GA) or indirectly (e.g. - recording a unique id that you can use to tie to personal info stored within your own system). If this is something you don't want to risk, I suggest moving to another analytics tool that does not have this sort of thing in their ToS (e.g. Adobe SiteCatalyst, which costs money, or perhaps you may instead prefer to choose an "in-house" approach, like Piwik)
If you are still determined to follow through with this and hope not to get caught or whatever, Google Analytics doesn't record data like what info a visitor filled out in a form (like their email address) unless you populate that data in a custom field/dimension/metric/event to be sent along with the request. Usually you would populate this on the form "thank you" page (which is usually the same page you use as your goal url or goal event if you're popping and using an event for your goal). So you would populate the email address in one of those custom variables and then have it as a dimension to break down the http referrer by.
my problem is follow:
I have an auctioneer site, in which many different objects will be auctioneerd.
My problem is very simple to clear for an more experience user I thinK. How I can handle business and database logic without opened a site or them?
My problem is to say directly, if nights at 3 no user is on the site, the winner (e.g.) must be set - if a page is opened or not.
So I need some kind of "every 2 seconds, do this method" - without opened a site.
My idea was a sepereate application which uses the same business and database-layer as the asp.net page and let this run at the server. Is that a good or bad idea?
The separate process (scheduled app or Windows service) is the only reliable way you can achieve this.
Using the same BLL and DAL are exactly the right thing to do too.
Check out this article on windows services http://msdn.microsoft.com/en-us/library/aa984074(VS.71).aspx
To let every user query the database every 2 seconds would create unnecessary traffic on your site, which is not a good idea. (users tend to refresh the page many times just before the auction closes anyway)
My thoughts:
Add a date to the auction when it closes.
The last user that places a bid is always the winner, and you can't place bids after 3 am (the date the auction closes), so if you visit the site after 3 am (you can't place a bid and) the winning user is displayed. If somebody opens the site just before 3 am and places a bid after 3 am your business logic should check the date of the bid and deny it.. (also: users might live in different timezones so consider displaying the server time on your site).
Setting the date to 'now' would close the auction immediately.
You can also add javascript to refresh the page if your clock passes the hour or something like that. (or use the number of seconds left before the auction closes in a setTimeout function or metarefresh)