to know user staying in certain page - javascript

For web-development. You will know the User's footstep with session and cookies.
but I have an different question.
If I want to know the number of users in certain page.
for example I create the news controller. and forward the users to
news.jsp page when they want.
maybe a certain number of people are visiting the news.jsp page at the same time.
if I want to count up the number of people who are staying in the same page.
How should I keep track users foot step.
later on I want to build an web-cite like keep track users
mouse event and also click event and analyse users behavior.
Give me some direction
Thank you

You can use google analytics. All you need to add is one JavaScript code.
Check here for more details:
https://moz.com/blog/absolute-beginners-guide-to-google-analytics

Related

Reload same page several times in Blogger/Blogspot will reduce bounce rate?

I'm trying to make a simple pagination in Blogger with Javascript. The idea is hiding the second paragraph, and show it when we click a button (and hide the first paragraph when we do so). The page will also be reloaded everytime the button clicked.
So, if my visitor reload the same page for several times, will it improve the bounce rate? Since it's the same URL.
It's a bit different with other self-hosted blog because they have different URL for each page. Something like:
domain.com/the-title?page=2 domain.com/the-title?page=3
domain.com/the-title?page=4
...etc
Also, will it affect the SEO? Is everything I hid in second paragraph will be invisible in Google search result?
The answer is NO. Let me explain the reasons why:
1.The bounce rate is increased when a user visits your page and leaves without interacting with your site / visiting another page.
2.Refreshing the page does not start a new session/pageview. No matter how many times they visit your site they will re-open the exact same session for 30mins.
3.Javascript refresh or meta refresh does not count as user interaction. You may also want to read more about Google and Javascripts. Google can read your content even if you use javascript or refresh for Dynamic content.
(http://searchengineland.com/tested-googlebot-crawls-javascript-heres-learned-220157)
4.Hiding any texts from the user is never a good idea. You may apply it in times that you need specific KPIs for clicks of buttons or cases like that but... can't you just use heatmaps or even better seperate content? Anyway, if you use it on a high percent of your content you might have Cloaking problems.(https://support.google.com/webmasters/answer/66355)
So it will not affect your bounce rate. You might get cloaking warning if you apply this on the majority of your website. It might also be considered a problematic user experience and lower your techincal seo scores (page load times etc.). As you can see you might only get problems by using such methods. I would suggest you to not proceed with the idea.

Best practice for tracking in page javascript interactions w/ Google Analytics

I have a question regarding best practice for a Google Analytics implementation.
I have a website that has static pages, on which there are several opportunities for javascript interaction. I'm interested in what the best practice is for tracking these interactions.
For Example: There is a button that prompts a modal where users can join a mailing list. On this modal, there is another button for users to submit their email address. I want to know how many people click the prompt button, and how many people continue to submit their email address.
To my knowledge there are two approaches on this--
Events - Trigger an event when the modal is prompted, and a second event when the information is entered and submitted.
Pageloads - Programatically trigger a pageload for each modal dialog.
If I use events, I can track the activity, but don't have access to good funneling tools when I set up conversions. There is the 'Event Funneling Report', but it doesn't give me to give the other correlation tools available with conversions.
I do have access to conversion funneling if I trigger pageloads, but the interactions are not pageloads, and I don't want to skew my other traffic metrics.
What is the best thing to do in this scenario? Thanks!
I too wish GA would expand on event tracking to allow the funnels to be more like the page view funnels. I have yet to see any real argument about why they can't.. But there's no real best practice for this other than going with the limitation you are more willing to deal with.
A couple of suggestions though:
If you go the page load route, prefix it w/ something unique e.g. "~events/..." something that wouldn't normally be a page on your site, so that you can more easily filter them out of your normal pages report. Alternatively, setup a view with a filter that excludes your virtual page name (e.g. "~events/..") so you can see your traffic without it and not have to worry about filtering it out in the reports. Alternatively, create a segment that does the same. None of this offers a perfect solution but it does somewhat help making it less crappy :/
If you go the event route, also pop a custom variable. help as far as creating a funnel but does open up looking at it through those reports.

How to load items on page only when page is scrolled down?

I'm new to ASP Web Pages. Trying to build a shopping like website. I have created Databases first, Now what I want is to display "some" items of users' interest only so as to keep page light. Later when user scrolls down, next "x" number of items are fetched from Database and are shown to the user. Its like something you can see on myntra.com, but definitely not like on ebay.com where number of items are fixed on one page. I know it will use javascript but can't figure out the correct timings of firing events and adding more items to page?? I saw on stackoverflow itself about scroll down event, but I think that was related to a particular ID on a page.
Here's how it's done on the client side:
http://www.youtube.com/watch?v=eziREnZPml4
In addition to that, you will need some server-side logic that will track what has been sent already, when a request for more contents comes in. One way you could achieve that is to always read the items in the same order, and have the browser send the "latest" item that it has with each subsequent request.

How to get the number of time a user visit a page?

Does anyone have any idea about how to get the number of time a user visit a particular site? For instance, if you do a search on google and there's a link that you clicked already, google will tell you how many times you have visited that particular link. Any ideas on how to code something like that using javascript?
Thanks.
In Google's case they can track that you have clicked on a link. Its a specific action that they can attach a javascript listener to. If you want to do the same thing on your own site, you can add some javascript that does something similar, and anytime a link is clicked an AJAX call can be made that will allow you to track that it was clicked.
However, if you are just looking to get some basic stats about pages on your site you can add Google Analytics to it, and it will gather a large amount of useful data for you.
http://www.google.com/analytics/
If you want to know how many people are visiting your page, you probably want to check out something like Google Analytics rather than making it yourself. It will give you a lot of data that you'd have to make a lot of effort to gather yourself.

Use jQuery to append star to menu item if the linked page's content has changed since last visit

I would like to create a similar effect to Apple's Safari 4 Beta Top Sites page -
when when you view it and a page's content has changed since you last visited, it displays a blue star in the top right hand corner to notify you.
I would like to do the very same, but only within my website and instead of an image I would like to append a '*' or some other character to the menu item's link.
I'm sure you would use the jQuery Cookie Plugin, but my scripting is not that advanced and I do not know how to dynamically change the cookie's content. Have I explained properly? How would I do it?
Many thanks in advance
Server side:
Read the website f.ex every minute and save the timestamp if changed content.
Save the users' visit timestamp to the page
Ajax:
Check if the websites update timestamp is newer than your visitors' timestamp, if yes make the star class visible, when the user clicks on the link, make the star disappear and update the users timestamp.
--
Showing a star or an image or whatever with Jquery is not the big deal here, it's a oneliner, the complex problem is to detect website changes, because minor changes can occur, but the main content could not change. The easiest way to do this would be if the website provides rss, then there's probable that the important new content will be published via rss.
You're asking a very vague question. Have you even attempted this? Please try it first then ask for help along the way.
Also, this is not something you necessarily need jQuery for. You could do it completely on the backend. But it's hard to say which solution is best for you without know anymore details.
I guess I would recommend using php and storing the cached page into a db (in other words the user would have a "fav pages" account) then when the user visits the "fav pages" webpage, you would fetch all the users favorite pages and compare it to what has been stored in the db. But for certain pages (for example if they have a date/time string), it would be very difficult to tell if the change was something the user wants to know about. Probably you would need to create a complex algorithm to decide what change is good change and what change is just certain website features.

Categories

Resources