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

Analytics/Pageviews script is not present #2089

Closed
1 task done
kdpuvvadi opened this issue Dec 5, 2024 · 1 comment
Closed
1 task done

Analytics/Pageviews script is not present #2089

kdpuvvadi opened this issue Dec 5, 2024 · 1 comment

Comments

@kdpuvvadi
Copy link

Checklist

How did you create the site?

Built from jekyll-theme-chirpy

Describe the bug

Added analytics and pageviews (goat counter) in config but generated build does not contain the relevant script.

analytics:
  goatcounter:
    id: kdpuvvadi

pageviews:
  provider: goatcounter

Steps To Reproduce

  • Add analytics with goatcounter in _config.yml
  • Add pageview's with goatcounter in _config.yml
  • build with bundle exec jekyll build`
  • Check generated output at _site

Only this is present in all the posts output

<!-- Pageviews -->

  

Expected Behavior

Presence of analytics and pageviews script in the pages

Environment

$ ruby -v
ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [x64-mingw-ucrt]

$ bundle exec jekyll -v
jekyll 4.3.4

$ bundle info jekyll-theme-chirpy
  * jekyll-theme-chirpy (7.2.0)
        Summary: A minimal, responsive, and feature-rich Jekyll theme for technical writing.
        Homepage: https://github.com/cotes2020/jekyll-theme-chirpy
        Documentation: https://github.com/cotes2020/jekyll-theme-chirpy/#readme
        Source Code: https://github.com/cotes2020/jekyll-theme-chirpy
        Wiki: https://github.com/cotes2020/jekyll-theme-chirpy/wiki
        Bug Tracker: https://github.com/cotes2020/jekyll-theme-chirpy/issues
        Path: c:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/jekyll-theme-chirpy-7.2.0

Anything else?

If there's any documentation regarding the analytics, please point me in that directon.

@kungfux
Copy link
Collaborator

kungfux commented Dec 5, 2024

"It works on my machine" (c)

<!-- Pageviews -->
<!-- Display GoatCounter pageviews -->
<script>
  let pv = document.getElementById('pageviews');
 ...

Note that analytics are only included for production builds. This is not the case for pageviews though.

P.S. Pageviews do not work as expected in v7.2.0 (see #2071) and will be fixed in v7.2.1.

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

3 participants