Merge pull request #553 from gradio-app/analytics-gtag

Disables google analytics if `analytics_enabled` is set ot False
This commit is contained in:
Abubakar Abid 2022-02-07 14:40:59 -05:00 committed by GitHub
commit 3c1b1f4dbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 32 additions and 6327 deletions

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,9 @@
<meta name="twitter:title" content="{{ config['title'] or '' }}">
<meta name="twitter:description" content="{{ config['simple_description'] or '' }}">
<meta name="twitter:image" content="{{ config['thumbnail'] or '' }}">
{%if config['analytics_enabled'] %}
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-156449732-1"></script>
{% endif %}
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {

View File

@ -1,4 +1,4 @@
Metadata-Version: 2.1
Metadata-Version: 1.0
Name: gradio
Version: 2.8.0a0
Summary: Python library for easily interacting with trained machine learning models
@ -6,9 +6,7 @@ Home-page: https://github.com/gradio-app/gradio-UI
Author: Abubakar Abid, Ali Abid, Ali Abdalla, Dawood Khan, Ahsen Khaliq
Author-email: team@gradio.app
License: Apache License 2.0
Description: UNKNOWN
Keywords: machine learning,visualization,reproducibility
Platform: UNKNOWN
License-File: LICENSE
UNKNOWN

View File

@ -1,5 +1,5 @@
analytics-python
aiohttp
analytics-python
fastapi
ffmpy
markdown-it-py[linkify,plugins]
@ -9,7 +9,7 @@ pandas
paramiko
pillow
pycryptodome
python-multipart
pydub
python-multipart
requests
uvicorn

View File

@ -20,7 +20,9 @@
<meta name="twitter:title" content="{{ config['title'] or '' }}">
<meta name="twitter:description" content="{{ config['simple_description'] or '' }}">
<meta name="twitter:image" content="{{ config['thumbnail'] or '' }}">
{%if config['analytics_enabled'] %}
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-156449732-1"></script>
{% endif %}
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {

View File

@ -195,6 +195,7 @@ def get_config_file(interface: Interface) -> Dict[str, Any]:
"show_input": interface.show_input,
"show_output": interface.show_output,
"title": interface.title,
"analytics_enabled": interface.analytics_enabled,
"description": interface.description,
"simple_description": interface.simple_description,
"article": interface.article,

View File

@ -25,10 +25,12 @@
content="{{ config['simple_description'] or '' }}"
/>
<meta name="twitter:image" content="{{ config['thumbnail'] or '' }}" />
{%if config['analytics_enabled'] %}
<script
async
src="https://www.googletagmanager.com/gtag/js?id=UA-156449732-1"
></script>
{% endif %}
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {