Glimesh / glimesh.tv

Glimesh is a next generation live streaming platform built by the community, for the community.
https://glimesh.tv
Other
461 stars 77 forks source link

Pull individual streamer website analytics from Plausible #590

Open clone1018 opened 3 years ago

clone1018 commented 3 years ago

@plausible our analytics provider has a new API that allows us to pull stats for a particular page, since we have each streamer namespaced out into their own URL it should be possible to show them the website stats for their stream page.

Looks like there's two main ways to pull this data: API: https://plausible.io/docs/stats-api#number-of-visitors-to-a-specific-page IFrame:

<iframe plausible-embed src="https://plausible.io/share/glimesh.tv?page=%2Fclone1018&period=7d&auth=some_code&embed=true&theme=light" scrolling="no" frameborder="0" loading="lazy" style="width: 1px; min-width: 100%; height: 1600px;"></iframe>
<div style="font-size: 14px; padding-bottom: 14px;">Stats powered by <a target="_blank" style="color: #4F46E5; text-decoration: underline;" href="https://plausible.io">Plausible Analytics</a></div>
<script async src="https://plausible.io/js/embed.host.js"></script>

Here's an example of the iframe: image

clone1018 commented 3 years ago

Ongoing discussion of improvements to the API: https://github.com/plausible/analytics/discussions/95

clone1018 commented 3 years ago

More API updates https://plausible.io/docs/stats-api