Hi,
We are trying to integrate aem and adobe analytics to show the PageViews and Unique Views details on Sites page analytics and Content Insight.
As we have custom pattern for pageName we tried to implement the server side page names as per the documentation - Implementing Server-Side Page Naming for Analytics .
The issue is getPageName(AnalyticsPageNameContext context) method from custom AnalytciPageNameProvider class is not getting invoked, so because of that we are always seeing incorrect data get stored on the pages.
Note: getResource(AnalyticsPageNameContext context) from custom class is getting invoked. We debugged the AEM 6.2 default analytics bundle and we didn't able to see any occurrence of calling getPageName from custom or default AnalytciPageNameProvider class.
Is this a bug in aem 6.2 or are we missing anything while doing the integration?
Any pointer to fix this will help us more.
Thanks in advance.
-Prem
Solved! Go to Solution.
here an example:
@Override | |
public Resource getResource(AnalyticsPageNameContext context) { | |
String pageName = context.getPageName(); | |
log.info("Entering getResource for pageName {}", pageName); | |
ResourceResolver rr = context.getResourceResolver(); | |
if ( ! pageName.startsWith("content")) { | |
pageName = "content:" + pageName; | |
} | |
pageName = "/" + StringUtils.replace(pageName, ":", "/"); | |
log.info("Search for page {}", pageName); | |
Resource resource = rr.resolve(pageName); | |
if ( resource.adaptTo(Page.class) != null) { | |
log.info("Page found"); | |
return resource; | |
} else { | |
log.info("Page not found"); | |
} | |
return null; | |
} |
I have asked internally to see if this is known issue.
~kautuk
Views
Replies
Total Likes
Thanks kautuk for your response!
Please confirm us back, once you got reply from internal team!.
-Prem
Views
Replies
Total Likes
The getResource() is called when data is imported from analytics.
getPageName() is called when the direct integration is used.
So this is how it is meant to be.
Views
Replies
Total Likes
here an example:
@Override | |
public Resource getResource(AnalyticsPageNameContext context) { | |
String pageName = context.getPageName(); | |
log.info("Entering getResource for pageName {}", pageName); | |
ResourceResolver rr = context.getResourceResolver(); | |
if ( ! pageName.startsWith("content")) { | |
pageName = "content:" + pageName; | |
} | |
pageName = "/" + StringUtils.replace(pageName, ":", "/"); | |
log.info("Search for page {}", pageName); | |
Resource resource = rr.resolve(pageName); | |
if ( resource.adaptTo(Page.class) != null) { | |
log.info("Page found"); | |
return resource; | |
} else { | |
log.info("Page not found"); | |
} | |
return null; | |
} |
Views
Likes
Replies
Views
Likes
Replies