Request for Statistical Data from GitLab

Hi Team,

I hope this message finds you well. I would like to request your assistance in extracting some specific statistical data from our GitLab environment to aid in our analysis of project utilization and user engagement.

  1. Number of Projects with GitLab Pages: Could we obtain a comprehensive list of all the projects currently hosted on GitLab that have been configured to utilize GitLab Pages? This data will help us understand the extent of our use of this feature across various projects.

  2. Count of Hosted Pages: For each of the projects identified in the first request, please provide the total number of individual “pages” hosted. This information will be valuable for assessing the content and resources we are deploying through GitLab Pages.

  3. User Access and Engagement Metrics: If possible, could you also provide any available information regarding user access to these hosted pages? Specifically, I am interested in metrics such as the number of unique users visiting these sites and the total number of hits or visits recorded. Understanding user engagement is crucial for us to evaluate the effectiveness of our hosted content.

Given that we have thousands of projects in GitLab, manually gathering this information is proving to be quite challenging and time-consuming. Your assistance in automating or streamlining this data extraction process would be immensely helpful.

Thank you in advance for your support. Please let me know if you need any additional details or if there are specific tools or permissions required to access this data.

Hi @KorbinSalazar :wave: Welcome to the GitLab Community forum :tada:

To get the data you’re looking for in 1 and 2, you can programatically use the GitLab REST API.

First you’ll need to enumerate and get project ids for all the projects on your instance (or in your group, if you’re using GitLab.com)

To get all projects at the instance level, you can use the following endpoint with an administrator (or auditor) access token: List all projects

If you’re using GitLab.com, you’ll want to get all groups and subgroups for your .com group namespace, then get a list of list projects within the root-level group namespace and all subgroup. You’ll need to authenticate using a Group owner’s access token to get all this data:

Once you have project ids for all the projects on your instance (or all projects under your group namespace), then you can use the Project Pages API to find which projects use GitLab pages:

I suggest using the glab CLI for bulk GitLab API requests, since it includes a handy --paginate flag option to handle pagination

Otherwise, you’ll find that you only get 20 results per API call. Additionally, using glab cli will avoid hitting rate limits (assuming you don’t issue a bunch of glab api requests in parallel).

For number 3,

  1. User Access and Engagement Metrics: If possible, could you also provide any available information regarding user access to these hosted pages? Specifically, I am interested in metrics such as the number of unique users visiting these sites and the total number of hits or visits recorded. Understanding user engagement is crucial for us to evaluate the effectiveness of our hosted content.

This is not available for GitLab pages. If this type of metric is important to you, you might consider using some sort of analytics service (Google Analytics, Matomo, etc.) on all GitLab pages sites in use. This typically require adding a JS snippet to the GitLab project source code.

2 Likes