Skip to content

Commit ad4b3c1

Browse files
tgberkeleyTom Gotsman
andauthored
unify tag (#49)
* unify tag * ruff fix --------- Co-authored-by: Tom Gotsman <[email protected]>
1 parent a961832 commit ad4b3c1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""Unify analytics tracking integration for Reflex applications."""
2+
3+
import reflex as rx
4+
5+
PIXEL_SCRIPT_UNIFY: str = """
6+
!function(){var e=["identify","page","startAutoPage","stopAutoPage","startAutoIdentify","stopAutoIdentify"];function t(o){return Object.assign([],e.reduce(function(r,n){return r[n]=function(){return o.push([n,[].slice.call(arguments)]),o},r},{}))}window.unify||(window.unify=t(window.unify)),window.unifyBrowser||(window.unifyBrowser=t(window.unifyBrowser));var n=document.createElement("script");n.async=!0,n.setAttribute("src","https://tag.unifyintent.com/v1/XAyM6RZXJzKpWH6mKPaB5S/script.js"),n.setAttribute("data-api-key","wk_DAwnkdfG_625skePqM8NZjq7jFvo6SnWFUPH2aRth"),n.setAttribute("id","unifytag"),(document.body||document.head).appendChild(n)}();"""
7+
8+
9+
def get_unify_trackers() -> rx.Component:
10+
"""Generate specific hardcoded Unify tracking components.
11+
12+
Returns:
13+
rx.Component: The PIXEL_SCRIPT_UNIFY script component
14+
"""
15+
return rx.script(PIXEL_SCRIPT_UNIFY)

0 commit comments

Comments
 (0)