Published
Edited
Mar 26, 2021
1 star
Insert cell
md`# Google Analytics Test`
Insert cell
html`<a href>`.href
Insert cell
pageAnalytics = {
const id = 'UA-143934306-5';
await require(`https://www.googletagmanager.com/gtag/js?id=${id}`).catch(
() => {}
);
const location = html`<a href>`;
gtag('js', new Date());
gtag('config', id, {
page_location: location.pathname,
page_path: location.href
});
return md`### Google Analytics Cell`;
}
Insert cell
function gtag() {
dataLayer.push(arguments);
}
Insert cell
mutable dataLayer = (window.dataLayer = window.dataLayer || [])
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more