Add reddit pixel in header

pull/8349/head
Kamran Ahmed 1 month ago
parent fd7f95c1a5
commit fe829442d1
  1. 19
      src/components/Analytics/RedditPixel.astro
  2. 2
      src/layouts/BaseLayout.astro

@ -0,0 +1,19 @@
<script>
// @ts-nocheck
!(function (w, d) {
if (!w.rdt) {
var p = (w.rdt = function () {
p.sendEvent
? p.sendEvent.apply(p, arguments)
: p.callQueue.push(arguments);
});
p.callQueue = [];
var t = d.createElement('script');
(t.src = 'https://www.redditstatic.com/ads/pixel.js'), (t.async = !0);
var s = d.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
}
})(window, document);
rdt('init', 'a2_ghq8846qpphp');
rdt('track', 'PageVisit');
</script>

@ -14,6 +14,7 @@ import '../styles/global.css';
import { PageVisit } from '../components/PageVisit/PageVisit';
import type { ResourceType } from '../lib/resource-progress';
import Clarity from '../components/Analytics/Clarity.astro';
import RedditPixel from '../components/Analytics/RedditPixel.astro';
export interface Props {
title: string;
@ -158,6 +159,7 @@ const gaPageIdentifier = Astro.url.pathname
<Analytics />
<Clarity />
<RedditPixel />
</head>
<body class='flex min-h-screen flex-col'>
<slot name='page-header'>

Loading…
Cancel
Save