Skip to content

Commit 3824c76

Browse files
authored
add chain family dl (#3310)
1 parent fd5a047 commit 3824c76

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/components/HeadCommon.astro

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,31 @@ const { title } = Astro.props
8181
})()
8282
</script>
8383

84+
<!-- Set CCIP Chain Family in dataLayer -->
85+
<script is:inline type="text/javascript">
86+
;(function () {
87+
if (!window.location.pathname.startsWith("/ccip")) return
88+
89+
try {
90+
var savedChain = localStorage.getItem("chainlink-docs-chain-type")
91+
// Default to "evm" if not set or invalid
92+
var chainFamily =
93+
savedChain === "solana" || savedChain === '"solana"'
94+
? "solana"
95+
: savedChain === "aptos" || savedChain === '"aptos"'
96+
? "aptos"
97+
: "evm"
98+
99+
window.dataLayer = window.dataLayer || []
100+
window.dataLayer.push({
101+
ccip_chain_family: chainFamily,
102+
})
103+
} catch (e) {
104+
// localStorage unavailable, skip tracking
105+
}
106+
})()
107+
</script>
108+
84109
<!-- Google Tag Manager (lazy init on first interaction or idle) -->
85110
<script type="text/javascript">
86111
;(function (w, d, s, l, i) {

0 commit comments

Comments
 (0)