Skip to content

WEB/DOC: use Plausible for analytics (using Scientific Python server) #53984

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,10 @@
"footer_start": ["pandas_footer", "sphinx-version"],
"github_url": "https://github.com/pandas-dev/pandas",
"twitter_url": "https://twitter.com/pandas_dev",
"analytics": {"google_analytics_id": "G-5RE31C1RNW"},
"analytics": {
"plausible_analytics_domain": "pandas.pydata.org",
"plausible_analytics_url": "https://views.scientific-python.org/js/script.js",
},
"logo": {"image_dark": "https://pandas.pydata.org/static/img/pandas_white.svg"},
"navbar_end": ["version-switcher", "theme-switcher", "navbar-icon-links"],
"switcher": {
Expand Down
8 changes: 1 addition & 7 deletions web/pandas/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=G-5RE31C1RNW"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){ dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-5RE31C1RNW');
</script>
<script defer data-domain="pandas.pydata.org" src="https://views.scientific-python.org/js/script.js"></script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to have this snippet in addition to the theme's analytics?

Copy link
Member Author

@jorisvandenbossche jorisvandenbossche Jul 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is for the website pages, which uses a different tool/theme/layout compared to the docs (which uses pydata-sphinx-theme)

<title>pandas - Python Data Analysis Library</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
Expand Down