Display visitor's count in my AEM application | Community
Skip to main content
Level 7
December 20, 2023
Solved

Display visitor's count in my AEM application

  • December 20, 2023
  • 2 replies
  • 1397 views

Hello All,

 

In my AEM application, I need to display the "X" users visited.
I mean User 1 has accessed my website after the site launch. So he is 1. Once 10th user visited my site, need to display
10 users visited. There are 3 publisher env. So, How can I achieve this problem?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

Hi @arunpatidar  SDI (Sling Dynamic Include) will help out here ?


Hi @mahesh_gunaje 
You can make a call to a servlet and don't cache it in dispatcher/CDN, that basically update the count in the node but again you have three publishers then you need to get the status from all the servers, you need kind of real time sync among the publishers.

 

If you use AEM then might end up with inconsistent count.

If you can use some external system or Analytics to push one more info that will make this easy.


2 replies

arunpatidar
Community Advisor
Community Advisor
December 20, 2023

Hi @mahesh_gunaje 
You can use cookie based solution, where you can add visit count in the cookie.
If you already have the data in other system then you can use that for example Google Analytics or any other analytic system.

 

However could you also addd details about the unique visitor criteria ?

Arun Patidar
Level 7
December 20, 2023

Hi @arunpatidar 

Hypothetical Scenario: I have a website for anonymous users. After the website launch, many users visited my website. At that time I want to display the count in my site. Person A has visited my website after the site launch. So, for him User count section of my website home page should show "1". Then, after subsequent request from his IP address will not be counted as different user. Then, 10th person has visited my site. For him, home pages "User count" section will show "10". After a week,  I am curious to know about the users visit to my website. So, I will clear my browser cache(or might hit the website from new device)  and will check my website. So, how can I achieve this type of functionality?

I know about Google Analytics. There we can configure our website to track the unique users count.  But is it possible to do from AEM site? by considering multiple publisher instance, dispatcher, caching concepts. Or by integrating Adobe Launch script ?

arunpatidar
Community Advisor
Community Advisor
December 20, 2023

@mahesh_gunaje 
You can do it from AEM side but not all the request will be hitting the publishers(due to cache) and no possibility to send the users actual IP to AEM and store it, it will be against the privacy policy.

You have to think around it when you store customer data.

Arun Patidar
joerghoh
Adobe Employee
Adobe Employee
December 22, 2023

I would strongly prefer the analytics approach @arunpatidar suggested. Everything else will not work as soon as you have more than a few visitors per day. And for that small audience AEM is simply too expensive.

Level 7
December 23, 2023

Hi @joerghoh 

 

In that case, configure the live site in Google Analytics (or may be in Adobe Analytics).

Then, hit the API from my live site home page section to display the total no. of visitors.  Let me know, if anyone did this type of implementation in their live site.