ddev / ddev

Docker-based local PHP+Node.js web development environments
https://ddev.com
Apache License 2.0
2.76k stars 602 forks source link

Marketing: Establish analytics for documentation and ddev.com #4367

Closed mayankguptadotcom closed 1 year ago

mayankguptadotcom commented 2 years ago

Is there an existing issue for this?

Is your feature request related to a problem?

As a product marketer, I'd like to have web analytics logging on docs & marketing website, so that we can learn about how visitors are coming to the website, how they're using the website and docs.

This will be crucial for expanding the marketing efforts, to come up with a sound marketing strategy and to improve the content requirements as we understand the visitors & user base.

Describe your solution

We'll need some sort of web analytics service to be installed on docs & website.

Discussed Solutions

Google Analytics (free)
Not open source, and concerning when it comes to GPDR.

Matomo (formerly Piwik)
Can be paid service or self-hosted with open source version, but collects more information than we may need at this stage.

Cloudflare Analytics
Free, easy to set up, and lightweight browser impact, but would need to move sites onto Cloudflare

Plausible
Can be paid service or self-hosted with open source version, collects limited information and is lightweight.

We may want to create the primary account with the non-profit organization’s email address and share access with regular members of the marketing group.

bserem commented 1 year ago

Thinking out loud here, but maybe platform.sh can provide an instance to DDEV (as they are sponsors) to host matomo? The hosting is the main blocking point, right?

rfay commented 1 year ago

AFAIK the only blocking is me getting around to it but haven't taken a look. But it's a good idea, if Platform uses matomo.

mayankguptadotcom commented 1 year ago

@bserem @rfay - thank you for bringing this up again.

Matomo can also be added as a free plugin in the current WordPress site as well. https://wordpress.org/plugins/matomo/

the only drawback is that it'll add the data in database, which will eventually make the database much larger.

mayankguptadotcom commented 1 year ago

Updated the ticket to add few new tasks and have updated the status of the ones completed.

rfay commented 1 year ago

Matomo would likely cost $23/month. If we think that's appropriate we can do it. https://matomo.org/pricing/

mayankguptadotcom commented 1 year ago

@rfay - it's tremendously helpful! I've used it extensively and we might even use it in the app, although I haven't tried that part personally. I've mostly used it for web analytics.

mattstein commented 1 year ago

FWIW I’ve used (and liked) Fathom for privacy-friendly analytics, and I appreciate their approach to being minimal and responsible with what they collect in the first place. As I understand it, Google Analytics can be GDPR-friendly but you need to give thought to its configuration and your privacy policy.

Plausible is similar to Fathom and can be self-hosted.

I used Piwik a long while ago and both of these seem a bit more modern (maybe trendy?) but any basic analytics will be useful.

mattstein commented 1 year ago

I see I’m assigned this:

to add the analytics code to current ddev.com, will need to add this plugin - https://wordpress.org/plugins/wp-piwik/

  1. Are we definitely set on Matomo? It seems more akin to Google Analytics, collecting more information than we need (counter to the spirit of GDPR compliance) with a larger bundled size for the visitor to download.
  2. Is there a reason to involve the WordPress plugin as opposed to adding an on-page snippet that doesn’t risk bloating the database?
mattstein commented 1 year ago

Just spoke with @mayankguptadotcom and we agreed that Matomo’s data collection, while possibly useful at some point, is probably excessive right now. In the interest of getting something running as soon as possible...

  1. If ddev.com uses Cloudflare for DNS, Mayank had the brilliant idea of enabling analytics there—which I didn’t realize was a thing. Free, very quick to set up, and sufficiently detailed metrics.
  2. If we aren’t using Cloudflare for DNS, and don’t want to, the next-best option would be Plausible. We can either sign up for the service or self-host since it’s an open source project. Unlike Motomo and Google Analytics, it’s lightweight on both data collection and JS bundle so it’s most respectful of the visitor.

I’d be happy to handle either approach myself if I can get the permissions for it. I trust Mayank will correct me if I’ve misrepresented any part of our chat!

mayankguptadotcom commented 1 year ago

@mattstein - Thank you so much for summarizing our discussion. I agree - that we can use Cloudflare Analytics, it's free, it's light and privacy focused. It has some limitations like these -

Does Cloudflare Web Analytics support UTM parameters? Not yet. UTM parameters are special query string parameters that can help track where traffic is coming from. Currently, Cloudflare Web Analytics do not log query strings to avoid collecting potentially sensitive data, but we may add support for this in the future.

Does Web Analytics support custom events? Not yet, but we may add support for this in the future.

But still, anything is better when it's free and offers privacy to the users. However, Plausible offers all that and I feel comfortable with using it too. And it seems its hosted version costs less than Matomo as well. I think my vote will go with Plausible keeping in mind that it'll be more helpful than Cloudflare analytics.

If everyone else is okay with it, then let's go with Plausible. And once this is added on the site, I'll delete the trial Matomo account.

rfay commented 1 year ago

Awesome.

@mattstein

If ddev.com uses Cloudflare for DNS, Mayank had the brilliant idea of enabling analytics there—which I didn’t realize was a thing. Free, very quick to set up, and sufficiently detailed metrics.

Do you mean for CDN, rather than DNS?

It looks like it's easy to set up Cloudflare CDN with Platform.sh, https://docs.platform.sh/domains/cdn/cloudflare.html, but we'd need to see the pricing, which might be about the same as other analytics.

But the Cloudflare CDN Pricing is pretty generous, including a "free" plan "For personal or hobby projects that aren’t business-critical" which might or might not be appropriate, or another level up for $20/month.

They also have an open source plan which we should qualify for.

However...

mattstein commented 1 year ago

Do you mean for CDN, rather than DNS?

No, I mean DNS; all Cloudflare’s free magic is available when it’s your primary DNS, unless you have a paid account where you can use it via CNAME only.

rfay commented 1 year ago

OK, ddev.com is currently DNS-served from AWS Route 9, but it could certainly be changed.

For cloudflare DNS I only see "Contact sales", https://www.cloudflare.com/dns

mattstein commented 1 year ago

If you go to set up any domain with Cloudflare, step one will be changing your nameservers—pretty much an all-or-nothing adventure unless you want to pay for business or enterprise accounts to pick and choose the services you utilize.

rfay commented 1 year ago

That sounds to me like "set up any domain with CDN" :)

mattstein commented 1 year ago

I’ve used a few CDNs where using a CNAME is normal, which isn’t the (standard) case with Cloudflare. Mostly because every record can be reverse-proxied with traditional CDN features along with a whole world of other options, including their cool-but-non-standard CNAME flattening and the aforementioned analytics.

mattstein commented 1 year ago

@mayankguptadotcom I updated the description to reflect the discussion thus far.

I know Randy has reached out to Cloudflare and I assume we’re waiting on that. If there’s anything I can do, or if we’d like to move forward with Plausible I’d be happy to help out. Mayank and I are both eager to see what our current analytics look like!

rfay commented 1 year ago

Judging from what I saw on the internet we may or may not ever hear from Cloudflare :(

mattstein commented 1 year ago

In that case, I’d vote for pushing ahead with Plausible so we have some analytics in place sooner than never. I can handle the setup and PR relevant projects with sufficient access to the account.

mayankguptadotcom commented 1 year ago

@rfay @mattstein - sounds great! Let's move ahead with Plausible. It'll be great to have the analytics.

mattstein commented 1 year ago

Excellent, if @rfay or someone with a DDEV-owned email address can sign up for an account and get me access somehow I’ll take care of the rest.

(Because I know that using my personal email address for an organization’s analytics inevitably leads to future pain and suffering.)

rfay commented 1 year ago

Here's the snippet:

<script defer data-domain="ddev.com" src="https://plausible.io/js/script.js"></script>

Bizarrely, they don't seem to have team access. ???

rfay commented 1 year ago

Figured it out, invited you two.

mattstein commented 1 year ago

Installed and deployed for ddev.com, so we’re now tracking there! The docs will be a little trickier but I’ll report back soon.

bserem commented 1 year ago

Docs are based on mkdocs. If I recall correctly you'll have to overwrite the default html template. Shout if you want me to have a look at it.

mattstein commented 1 year ago

Thanks @bserem! I’m over here looking into it now, and it should work with pushState() by default.

mattstein commented 1 year ago

Can close this out once that PR’s merged. Thanks everybody!