Skip to content

Commit

Permalink
Allow google analytics to work on Spaces (and other iframe situations) (
Browse files Browse the repository at this point in the history
#6427)

* ga on spaces

* add changeset

* format

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
  • Loading branch information
abidlabs and gradio-pr-bot committed Nov 16, 2023
1 parent 2777f32 commit e0fc146
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changeset/slimy-oranges-dress.md
@@ -0,0 +1,7 @@
---
"@gradio/app": minor
"gradio": minor
"website": minor
---

feat:Allow google analytics to work on Spaces (and other iframe situations)
4 changes: 3 additions & 1 deletion js/_website/src/routes/+layout.svelte
Expand Up @@ -69,7 +69,9 @@
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "UA-156449732-1");
gtag("config", "UA-156449732-1", {
cookie_flags: "samesite=none;secure"
});
</script>

<script
Expand Down
4 changes: 3 additions & 1 deletion js/app/src/Blocks.svelte
Expand Up @@ -686,7 +686,9 @@
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "UA-156449732-1");
gtag("config", "UA-156449732-1", {
cookie_flags: "samesite=none;secure"
});
</script>
{/if}
</svelte:head>
Expand Down

0 comments on commit e0fc146

Please sign in to comment.