Expand my Community achievements bar.

Webinar: Adobe Customer Journey Analytics Product Innovations: A Quarterly Overview. Come learn for the Adobe Analytics Product team who will be covering AJO reporting, Graph-based Stitching, guided analysis for CJA, and more!
SOLVED

I want to get daily page visits with adobe analytics api

Avatar

Level 2

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;

 

DateTotalVisitCount
01.01.2024500
02.01.2024700
03.01.20241500
04.01.2024300
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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:

Jennifer_Dungan_0-1704173750546.png

 

This will add a new icon to your freeform tables:

Jennifer_Dungan_1-1704173786192.png

 

If you click on that icon, it will give you the option of "Freeform Table" or "Sparkline", choose the table:

Jennifer_Dungan_2-1704173823989.png

 

Now, it will show you timestamps of the calls that were made:

Jennifer_Dungan_3-1704173849526.png

 

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.

View solution in original post

10 Replies

Avatar

Community Advisor

Hey @ünalav 

 

Here is the link to the entire analytics API documentation.

 

https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/i-want-to-get-daily-zayfa...

 

It has all the endpoints you would need.

 

If you need any further help, let us know.

 

Cheers,

Abhinav

Avatar

Level 2

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. :))

Avatar

Correct answer by
Community Advisor

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:

Jennifer_Dungan_0-1704173750546.png

 

This will add a new icon to your freeform tables:

Jennifer_Dungan_1-1704173786192.png

 

If you click on that icon, it will give you the option of "Freeform Table" or "Sparkline", choose the table:

Jennifer_Dungan_2-1704173823989.png

 

Now, it will show you timestamps of the calls that were made:

Jennifer_Dungan_3-1704173849526.png

 

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.

Avatar

Community Advisor

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)

Avatar

Community Advisor

@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

Avatar

Level 2

@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.

Avatar

Community Advisor

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!

 

Avatar

Level 2

@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.

Avatar

Community Advisor

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.