Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gatsby-plugin-google-analytics]: DNS prefetch google analytics domain in head #11714

Closed
maciekmaciej opened this issue Feb 12, 2019 · 7 comments

Comments

@maciekmaciej
Copy link
Contributor

Summary

I saw that gatsby website is doing this:
https://github.com/gatsbyjs/gatsby/blob/master/www/gatsby-ssr.js#L10
And I'm wondering if it's a good idea to do it by default in gatsby-plugin-google-analytics.

Motivation

Maybe things will go a little faster with that approach.

@pieh
Copy link
Contributor

pieh commented Feb 12, 2019

@m-allanson do you remember if there was reason we added this just for gatsbyjs.org and not to google analytics plugin directly?

@m-allanson
Copy link
Contributor

I have no idea why I did it like that 😅

It seems like a good idea to add it to the google analytics plugin though. It's something that gets highlighted during a Lighthouse audit. Looking at the audit for gatsbyjs.org:

screenshot 2019-02-12 at 15 37 03

Does google analytics (GA) always connect to google.com too? That could be worth investigating, and adding if it's a domain that GA always connects to.

@maciekmaciej
Copy link
Contributor Author

maciekmaciej commented Feb 12, 2019

I found all these in source:

  • //www.google-analytics.com
  • //www.google.com
  • //stats.g.doubleclick.net
  • //ampcid.google.com

but only //www.google-analytics.com and //www.google.com appears to be used often when I look on requests while browsing some sites.

I can make a PR for that and add these two domains. I would use relative protocol // since analytics.js would use http:// if site is served with that.

It's also worth looking into this aspect in gatsby-plugin-google-tagmanager plugin.

@gatsbot
Copy link

gatsbot bot commented Mar 5, 2019

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

Thanks for being a part of the Gatsby community! 💪💜

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Mar 5, 2019
@heyayush
Copy link

heyayush commented Mar 5, 2019

Keep open

@m-allanson m-allanson added not stale and removed stale? Issue that may be closed soon due to the original author not responding any more. labels Mar 5, 2019
@LekoArts LekoArts removed the not stale label Sep 4, 2019
@dougwithseismic
Copy link

Anyone working on this? I'll pick it up if not.

@wardpeet
Copy link
Contributor

@dougwithseismic Thank you for wanting to contribute, sadly we already have support for it and it was added in #12826.

I'll be closing this one for that reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants