{"id":14970991,"url":"https://github.com/blackboxvision/gatsby-source-analytics-most-read-posts","last_synced_at":"2025-10-26T14:31:00.974Z","repository":{"id":42881617,"uuid":"256070484","full_name":"BlackBoxVision/gatsby-source-analytics-most-read-posts","owner":"BlackBoxVision","description":":rocket: Get your most read Posts from Google Analytics Reporting API.","archived":false,"fork":false,"pushed_at":"2022-12-06T18:04:32.000Z","size":218,"stargazers_count":6,"open_issues_count":6,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-11T05:01:51.189Z","etag":null,"topics":["gatsby","gatsby-plugin","library","nodejs","react"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BlackBoxVision.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-16T00:40:51.000Z","updated_at":"2021-01-22T06:28:56.000Z","dependencies_parsed_at":"2023-01-24T11:00:13.597Z","dependency_job_id":null,"html_url":"https://github.com/BlackBoxVision/gatsby-source-analytics-most-read-posts","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackBoxVision%2Fgatsby-source-analytics-most-read-posts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackBoxVision%2Fgatsby-source-analytics-most-read-posts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackBoxVision%2Fgatsby-source-analytics-most-read-posts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackBoxVision%2Fgatsby-source-analytics-most-read-posts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlackBoxVision","download_url":"https://codeload.github.com/BlackBoxVision/gatsby-source-analytics-most-read-posts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219862782,"owners_count":16555951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gatsby","gatsby-plugin","library","nodejs","react"],"created_at":"2024-09-24T13:44:28.338Z","updated_at":"2025-10-26T14:30:55.708Z","avatar_url":"https://github.com/BlackBoxVision.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gatsby Source for Most Read Posts from Google Analytics [![npm version](https://badge.fury.io/js/%40blackbox-vision%2Fgatsby-source-google-analytics-api-most-read-posts.svg)](https://badge.fury.io/js/%40blackbox-vision%2Fgatsby-source-google-analytics-api-most-read-posts) [![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT) [![Known Vulnerabilities](https://snyk.io/test/github/blackboxvision/gatsby-source-analytics-most-read-posts/badge.svg)](https://snyk.io/test/github/blackboxvision/gatsby-source-analytics-most-read-posts)\n\nGet your most read Posts from Google Analytics Reporting API.\n\n## Install\n\nYou can install this library via NPM or YARN.\n\n### NPM\n\n```bash\nnpm i @blackbox-vision/gatsby-source-google-analytics-api-most-read-posts\n```\n\n### YARN\n\n```bash\nyarn add @blackbox-vision/gatsby-source-google-analytics-api-most-read-posts\n```\n\n## Config\n\nIn your `gatsby-config.js`:\n\n```javascript\n{\n    resolve: `@blackbox-vision/gatsby-source-google-analytics-api-most-read-posts`,\n    options: {\n        viewId: `115350264`,\n        email: `example@domain.com`,\n        secretKey: `yourSecretAPIKey`,\n        maxResults: 10,\n        filters: 'ga:pagePath!@/tag/;ga:pagePath!@/page/;ga:pagePath!=/;ga:pageTitle!=(not set);ga:pagePath!@\u0026',\n        dates: {\n            from: 'today',\n            to: '2019-01-01'\n        }\n    }\n}\n```\n\n## Supported Options\n\n| Properties | Types  | Default Value | Description                                                      |\n| ---------- | ------ | ------------- | ---------------------------------------------------------------- |\n| viewId     | string | none          | Your viewId for your Google Analytics property.                  |\n| email      | string | none          | The email generated from the Google API Console.                 |\n| secretKey  | string | none          | The PEM certificate generated from the Google API Console.       |\n| maxResults | number | 3             | Total results to get from the source.                            |\n| filters    | string | ''            | Filters for data from Google Analytics.                          |\n| dates.from | string | 'today'       | A date formatted string or an string representing time relation. |\n| dates.to   | string | '2019-01-01'  | A date formatted string or an string representing time relation. |\n\n## Example Usage\n\n```javascript\nimport React from 'react';\nimport { StaticQuery, graphql } from 'gatsby';\n\nconst gplQuery = graphql`\n  query GetAllMostReadPosts {\n    allMostReadPosts {\n      nodes {\n        totalViews\n        title\n        url\n      }\n    }\n  }\n`;\n\nexport const MostReadPosts = () =\u003e (\n  \u003cStaticQuery\n    query={gplQuery}\n    render={({ allMostReadPosts: { nodes: posts } }) =\u003e\n      posts.map((post, idx) =\u003e (\n        \u003cdiv key={idx}\u003e\n          \u003ca href={post.url}\u003e\n            \u003ch2\u003e{post.title}\u003c/h2\u003e\n          \u003c/a\u003e\n        \u003c/div\u003e\n      ))\n    }\n  /\u003e\n);\n\nMostReadPosts.displayName = 'MostReadPosts';\n```\n\n## Issues\n\nPlease, open an [issue](https://github.com/BlackBoxVision/gatsby-source-analytics-most-read-posts/issues) following one of the issues templates. We will do our best to fix them.\n\n## Contributing\n\nIf you want to contribute to this project see [contributing](https://github.com/BlackBoxVision/gatsby-source-analytics-most-read-posts/blob/master/CONTRIBUTING.md) for more information.\n\n## License\n\nDistributed under the **MIT license**. See [LICENSE](https://github.com/BlackBoxVision/gatsby-source-analytics-most-read-posts/blob/master/LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackboxvision%2Fgatsby-source-analytics-most-read-posts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblackboxvision%2Fgatsby-source-analytics-most-read-posts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackboxvision%2Fgatsby-source-analytics-most-read-posts/lists"}