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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃搱 Add GTM #119

Merged
merged 2 commits into from
Apr 27, 2023
Merged

馃搱 Add GTM #119

merged 2 commits into from
Apr 27, 2023

Conversation

Grsmto
Copy link
Contributor

@Grsmto Grsmto commented Apr 26, 2023

following Hub setup.

closes #114

following Hub setup
@Grsmto Grsmto requested a review from SBrandeis April 26, 2023 14:33
@Grsmto Grsmto changed the title 馃搱 add GTM 馃搱 Add GTM Apr 26, 2023
Copy link
Member

@coyotte508 coyotte508 left a comment

Choose a reason for hiding this comment

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

Thanks!

cc @Pierrci or @SBrandeis if you want to chime in

Copy link
Member

@Pierrci Pierrci left a comment

Choose a reason for hiding this comment

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

LGTM!

src/app.html Outdated Show resolved Hide resolved
Co-authored-by: Pierric Cistac <Pierrci@users.noreply.github.com>
@Grsmto Grsmto merged commit 572bb0e into main Apr 27, 2023
@Grsmto Grsmto deleted the analytics branch April 27, 2023 08:46
<script>
if (["hf.co", "huggingface.co"].includes(window.location.hostname)) {
const script = document.createElement("script");
script.src = "https://www.googletagmanager.com/gtag/js?id=G-8Q63TH4CSL";
Copy link
Member

Choose a reason for hiding this comment

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

but this should be made configurable through an env var no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's hardcoded on moon-landing so I just did the same thing, but yes I agree.

Copy link
Member

Choose a reason for hiding this comment

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

yep i mean just the id part

Comment on lines +33 to +34
gtag("js", new Date());
/// ^ See https://developers.google.com/tag-platform/gtagjs/install

Choose a reason for hiding this comment

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

I think it's missing:

gtag("config", "G-8Q63TH4CSL")

Copy link
Member

Choose a reason for hiding this comment

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

ah maybe, I thought it was redundant with ?id=G-8Q63TH4CSL in the URL of the script, but maybe it's not indeed

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

Successfully merging this pull request may close these issues.

Add analytics like on the hub
5 participants