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

Google Analytics data not received #561

Closed
CLeBeRFR opened this issue Nov 27, 2020 · 11 comments · Fixed by #596
Closed

Google Analytics data not received #561

CLeBeRFR opened this issue Nov 27, 2020 · 11 comments · Fixed by #596
Labels
frozen-due-to-age has-pull-request A proposed change on merge will close this

Comments

@CLeBeRFR
Copy link

I create an account on Google Analytics. It generates me an ID which starts with G-BXXXXXX.
I put it in _config.yml:

title: My Blog
email:
google_analytics: G-BXXXXXX
description: >- # this means to ignore newlines until "baseurl:"
  My blog
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com

# Build settings
theme: minima
plugins:
  - jekyll-feed

When I visit the page, I see the code :

<script>
if(!(window.doNotTrack === "1" || navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1")) {
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'G-BXXXXXX', 'auto');
  ga('send', 'pageview');
}
</script>

My problem is maybe linked with #555

@zsomborkoman
Copy link

Hi,

I have a similar issue. I have inspected the https://github.com/jekyll/minima/blob/master/_includes/google-analytics.html file and it seems that the last modification "Migrate from analytics.js to gtag.js" (#281) is not included in the 2.5.1 release version (although, I think it was committed before).

Check: tried running the commands from the last committed version through the JS console, I could see 1 pageview appear on analytics using a measurement_ID (instead of tracking_ID). But nothing happens with the current version. I think simply releasing a package with the commit mentioned above could solve some of these issues.

I am using it through GitHub Pages, so I will have to wait until the GP dependency version for minima rolls as well.

@ashmaroli
Copy link
Member

@zsomborkoman Since you're on GitHub Pages, you can utilize unreleased changes easily by using the jekyll-remote-theme plugin.
Simply update your config file as below:

# _config.yml

- theme: minima
+ remote_theme: jekyll/minima

  plugins:
+ - jekyll-remote-theme

@CLeBeRFR
Copy link
Author

OK, so it's a bug. Personally I included the code provided by Google directly into my Jekyll template to have it on each page.
Hope someone will fix it.

@jekyllbot
Copy link
Contributor

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

@harisonmg
Copy link

I'm having a similar issue with Google Analytics for the minima theme deployed on Netlify. I tried adding the environment variable, and although I can see the script, I don't receive any data

@jekyllbot
Copy link
Contributor

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

@jekyllbot jekyllbot added the has-pull-request A proposed change on merge will close this label Jul 16, 2021
karpoftea pushed a commit to karpoftea/karpoftea.github.io that referenced this issue Aug 20, 2021
joereddington added a commit to eQualityTime/projectreal that referenced this issue Aug 25, 2021
[O[Ihttps://github.com/jekyll/minima/issues/561)

So I've put the relevent GA4 in an included head.html file.
@dotchev
Copy link

dotchev commented Mar 23, 2022

Using the remote theme fixed the issue for me

@jekyllbot jekyllbot removed the stale label Mar 23, 2022
@victor-w-ma
Copy link

It is surprising that there has not been a new release for 3 years and 153 commits. When will Jekyll release a new version?

babakks added a commit to babakks/babakks.github.io that referenced this issue Aug 25, 2022
Signed-off-by: Babak K. Shandiz <[email protected]>

As discussed in the link below, the released version of the jekyll
minima theme, does not handle Google Analytics plugin well. So, the
solution is to opt using `remote-theme` field and not using the theme's
latest released version:
  jekyll/minima#561
@XilinJia
Copy link

@zsomborkoman Since you're on GitHub Pages, you can utilize unreleased changes easily by using the jekyll-remote-theme plugin. Simply update your config file as below:

# _config.yml

- theme: minima
+ remote_theme: jekyll/minima

  plugins:
+ - jekyll-remote-theme

Hi, I put this in, but it doesn't seem to work. Google analytics still shows 0 users for my github pages https://xilinjia.github.io

@XilinJia
Copy link

@zsomborkoman Since you're on GitHub Pages, you can utilize unreleased changes easily by using the jekyll-remote-theme plugin. Simply update your config file as below:

# _config.yml

- theme: minima
+ remote_theme: jekyll/minima

  plugins:
+ - jekyll-remote-theme

Hi, I put this in, but it doesn't seem to work. Google analytics still shows 0 users for my github pages https://xilinjia.github.io

Hey, The remote theme solution actually works. Interestingly, I've been testing it on Brave browser which reportedly blocks google analytics, so it never worked. When I access my site through Firefox or Chrome, then I can see it from google analytics.

@shivioua
Copy link

shivioua commented Jan 5, 2023

If you're using slate tempate then look into this issue:
pages-themes/slate#49

hunszasz pushed a commit to hunszasz/hunszasz.github.io that referenced this issue Jan 30, 2023
hugocarlos added a commit to hugocarlos/hugocarlos.github.io that referenced this issue Feb 7, 2023
plugin added to 'gems:'
Following jekyll/minima#561
meltem pushed a commit to meltem/meltem.github.io that referenced this issue Apr 11, 2023
scottcolfer added a commit to scottcolfer/scottcolfer.github.io that referenced this issue May 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age has-pull-request A proposed change on merge will close this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants