Hi everyone, how can I get page visits with api? I would be very grateful if anyone can help with this. I am writing an application with csharp, I want to get this data with api. at least tell me from which end-point I can get this data.
I model the example of the data set I want below;
Date | TotalVisitCount |
01.01.2024 | 500 |
02.01.2024 | 700 |
03.01.2024 | 1500 |
04.01.2024 | 300 |
Solved! Go to Solution.
Views
Replies
Total Likes
Here is a little known trick... Workspaces are all built using the API and if you can build the freeform table to return the data that you want, you can actually get the API call(s) used to return the data.
First you need to enable debugger mode in Workspace:
This will add a new icon to your freeform tables:
If you click on that icon, it will give you the option of "Freeform Table" or "Sparkline", choose the table:
Now, it will show you timestamps of the calls that were made:
If you refresh multiple times, you may have multiple timestamps, or if you have a complex table with multiple breakdowns, it may require multiple calls.
Choose the appropriate timestamp(s) and this will open a new screen that will show you the API call that was used in multiple formats. You can copy the one you want to use, and if you need to make modifications, you can do so on this pre-build functional API call.
Views
Replies
Total Likes
Hey @ünalav
Here is the link to the entire analytics API documentation.
It has all the endpoints you would need.
If you need any further help, let us know.
Cheers,
Abhinav
Views
Replies
Total Likes
hi, thanks for the answer but link is incorrect. I can see all endpoints in the documentation but I could not find them. why is everyone here saying the documentation answer. no one wants to help directly, they suggest documentation. I didn't think of that?
I'm just looking for an endpoint where I can get the total number of daily visitors. I don't need all the documentation. :))
Here is a little known trick... Workspaces are all built using the API and if you can build the freeform table to return the data that you want, you can actually get the API call(s) used to return the data.
First you need to enable debugger mode in Workspace:
This will add a new icon to your freeform tables:
If you click on that icon, it will give you the option of "Freeform Table" or "Sparkline", choose the table:
Now, it will show you timestamps of the calls that were made:
If you refresh multiple times, you may have multiple timestamps, or if you have a complex table with multiple breakdowns, it may require multiple calls.
Choose the appropriate timestamp(s) and this will open a new screen that will show you the API call that was used in multiple formats. You can copy the one you want to use, and if you need to make modifications, you can do so on this pre-build functional API call.
Views
Replies
Total Likes
I will try and write you back, thank you.
You're welcome, good luck!
While you can write APIs from scratch, there are so many options that its much easier to start with something that is pre-built to get you what you want (or at least get you close - then to modify a little to get it the rest of the way)
Views
Replies
Total Likes
@Jennifer_Dungan Thanks Jen for the details.
@ünalav Apologies mate if the earlier response didn't work for you but there are indeed peers who are oblivious of the link too that I shared earlier, so it is at times a starting point. Jen's answer should suffice but if you do need further help let us know.
Cheers,
Abhinav
@Jennifer_Dungan first of all I would like to express my gratitude to you. I got the data I wanted.
I have 2 more questions and I ask for your understanding.
How long is this token valid? Or how can I generate a new token for this place? Is it necessary to generate a new token for each request or is it valid for life?
Apart from that, how can I get page based count, can you explain that when you have time?
Thanks a lot again.
I'm glad that worked for you
How long is this token valid? Or how can I generate a new token for this place? Is it necessary to generate a new token for each request or is it valid for life?
That I am not sure, we haven't actively used APIs for many years, not since API 1.4.. back then it was a permanent secret key (which could be re-generated if/when needed) that was tied to a specific login.... with the new Tokenization I am not sure how long it will last... I believe it shouldn't be a new token for each request... it should last a while (for this and other requests)... but whether it lasts for life, or expires after a while I am not sure.... sorry.
I found these, hopefully they are helpful when :
https://developer.adobe.com/developer-console/docs/guides/authentication/ServerToServerAuthenticatio...
https://developer.adobe.com/commerce/webapi/get-started/authentication/gs-authentication-token/
Apart from that, how can I get page based count, can you explain that when you have time?
Do you mean "page view" metric for a similar Day based report?
Why not build your freeform table with a column for Visits and a column for Page Views and use the same API call to retrieve both sets of data?
Or do you need a list of pages (based on the "Page" dimension) and a metric of your choosing? You can create another freeform table with the info and get the API call... however, you will notice that it will only return a small amount of data... this is where modifying the API comes in... you can change the limit (I believe up to 50,000) and if that's not enough, you can use the "page" setting to make multiple calls by pagination.
"settings": {
"limit": 50000,
"page": 0
},
You can look many of the API syntax for different reports here:
https://adobedocs.github.io/analytics-2.0-apis/
And here is a video showing a test using Postman:
https://experienceleague.adobe.com/docs/analytics-learn/tutorials/apis/using-postman-to-make-adobe-a...
Good luck!
Views
Replies
Total Likes
@Jennifer_Dungan thank you very much for your help. Without your answers I would not have been able to solve this. I am very grateful to you.
You're very welcome!
Though, I am sure you would have figured it out eventually... it would have just taken a lot longer and involved a lot more headaches.
Way back in the day, we didn't have this for API 1.3 and 1.4... so we did have to manually make all the API calls.. there was a lot of trial and error to test various solutions and finally get the results we wanted.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies