~udia/udia.ca

ef03db3f019af6916b427fc07d8d8a7159e36e28 — Alexander Wong 7 months ago 1b1583e
update script tag to use serverless function
2 files changed, 2 insertions(+), 1 deletions(-)

M functions/analytics.ts
M themes/candid/layout/layout.ejs
M functions/analytics.ts => functions/analytics.ts +1 -0
@@ 1,3 1,4 @@
// Cheeky way of getting around ad blockers?
export const onRequest = async (_context) => {
  // const { data, env, next, params, request, waitUntil } = context;
  return fetch('https://static.cloudflareinsights.com/beacon.min.js')

M themes/candid/layout/layout.ejs => themes/candid/layout/layout.ejs +1 -1
@@ 6,6 6,6 @@
    <section id="main"><%- body %></section>
    <%- partial('_partial/footer', null, {cache: !config.relative_link}) %>
  </div>
  <script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "70955f29972649bfac0febeb3d6ffee9"}'></script>
  <script defer src='/analytics' data-cf-beacon='{"token": "70955f29972649bfac0febeb3d6ffee9"}'></script>
</body>
</html>
\ No newline at end of file