mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-24 10:54:04 +08:00
disabled google analytics if analytics disabled
This commit is contained in:
parent
4f9ab42b67
commit
9f2f5879e6
@ -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() {
|
||||
|
@ -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,
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user