1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-09-02 13:52:46 +02:00

Add reddit pixel in header

This commit is contained in:
Kamran Ahmed
2025-03-18 20:12:47 +00:00
parent fd7f95c1a5
commit fe829442d1
2 changed files with 21 additions and 0 deletions

View File

@@ -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>

View File

@@ -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'>