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

Allow google analytics to work on Spaces (and other iframe situations) #6427

Merged
merged 4 commits into from Nov 16, 2023

Conversation

abidlabs
Copy link
Member

Following https://stackoverflow.com/questions/74494818/google-analytics-not-working-for-web-site-embeded-in-iframe (thanks for sharing @aliabd), modified our google analytics tag to work on Spaces.

Not sure if there's an easy way to test that this is working, but will take a look at our GA to see if anything shows up due to the deployed Space PR.

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Nov 15, 2023

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
Storybook ready! Storybook preview
Visual tests all good! Build review
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/b9475abad72f8051f93ed94636fd25e4bc49a245/gradio-4.3.0-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@b9475abad72f8051f93ed94636fd25e4bc49a245#subdirectory=client/python"

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Nov 15, 2023

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/app minor
gradio minor
website minor
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Allow google analytics to work on Spaces (and other iframe situations)

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@aliabd
Copy link
Collaborator

aliabd commented Nov 15, 2023

Yes we should be able to use the deployed space to check

@aliabd
Copy link
Collaborator

aliabd commented Nov 15, 2023

actually @abidlabs i think something more complicated is happening. I think spaces is removing the gtag code inside the iframe... it doesn't show up even on the iframed domain: https://gradio-pr-deploys-pr-6427-all-demos.hf.space/ try looking for it in inspect element

whereas shows up fine locally, on colab etc

@aliabd
Copy link
Collaborator

aliabd commented Nov 15, 2023

nvm like you pointed out it's cause we disable analytics on pr spaces. ignore what i said

@abidlabs abidlabs requested a review from hysts November 15, 2023 04:20
@abidlabs abidlabs marked this pull request as draft November 15, 2023 06:56
@abidlabs abidlabs marked this pull request as ready for review November 16, 2023 21:30
@abidlabs
Copy link
Member Author

Thanks @aliabd for debugging this with me!

@abidlabs abidlabs merged commit e0fc146 into main Nov 16, 2023
20 checks passed
@abidlabs abidlabs deleted the ga-spaces branch November 16, 2023 21:32
@pngwn pngwn mentioned this pull request Nov 16, 2023
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.

None yet

3 participants