0

I've a question for an application I want to develop. This is a custom e-commerce platform, and I try to show the visitors how many other people are viewing the page right now.

How can I do this using Angular2 and a .NET API?

4
  • developers.google.com/analytics/devguides/collection/… Commented Aug 21, 2017 at 13:57
  • This is for traffic stats.. I want to show real-time stats of people currently viewing the page. Commented Aug 21, 2017 at 14:00
  • 1
    The scope of the question is pretty wide. You should break down into small problems and try to resolve those. For ex. How would you count the currently online visitors, how would you retrieve them and at last how would you display them in angular 2. Commented Aug 21, 2017 at 14:20
  • you should use google analytics for that, there is no point to bother of coding that logic yourself unless you have a some sort of unique use case that google analytics cant handle. Commented Aug 22, 2017 at 2:35

1 Answer 1

1

Angular is client-side only and runs in the browser for ONE user. So it would have no way to know which other uses are using the application or count them.

You would have to do some type of counting on the server side. You could then have that number accessible via ASP.NET Web API or some other REST-ful service.

The Angular app can then retrieve the value using Http and display it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.