I would like to retrieve page views count and timestamp associated with a specific contact filtered by a day.
as given below in screenshot
I have checked The contact api - Get a contact by its vid. It is return total number of page views by contacts wheras I want a page views count per day viewed by contact as given above.
Could someone please guide me on how to achieve this, or let me know if there is an API that supports this requirement?
Hi @Mahadev
Use the property with the history option, select the no of pages viewed on the property, and get its history. Have shared of response for the same
here is the curl curl --request GET \
--url 'https://api.hubapi.com/crm/v3/objects/contacts/?propertiesWithHistory=hs_analytics_num_page_views&archived=false' \
--header 'authorization: Bearer YOUR_ACCESS_TOKEN'
I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!
Hi @GRajput
I tried the API you provided with the history option. In the response array, I noticed that my contact has a total of 369 page views, but the “hs_analytics_num_page_views” field in the response is returning only 54 records.
It seems this value doesn’t represent the total page views we’re looking for; it might be something else. We need the total page views broken down by day or by date.
Hi @Mahadev
The property history will only return a limited number of historical changes. If a contact’s property has changed frequently, some older history might not be accessible via the API.
I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!
Hi @GRajput ,
Thank you for the explanation. How can I get all the visited page view instead of limited number of historical changes? Is there anything can solve my requirement need ?
I have been able to find the API to get all page views by conatct with all details of page instance. here is the API
https://api.hubapi.com/events/v3/events?objectType=contact&objectProperty.email={email}&eventType=e_visited_page
you can group the pages by an hour or day from list getting in response