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:
19
src/components/Analytics/RedditPixel.astro
Normal file
19
src/components/Analytics/RedditPixel.astro
Normal 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>
|
@@ -14,6 +14,7 @@ import '../styles/global.css';
|
|||||||
import { PageVisit } from '../components/PageVisit/PageVisit';
|
import { PageVisit } from '../components/PageVisit/PageVisit';
|
||||||
import type { ResourceType } from '../lib/resource-progress';
|
import type { ResourceType } from '../lib/resource-progress';
|
||||||
import Clarity from '../components/Analytics/Clarity.astro';
|
import Clarity from '../components/Analytics/Clarity.astro';
|
||||||
|
import RedditPixel from '../components/Analytics/RedditPixel.astro';
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
title: string;
|
title: string;
|
||||||
@@ -158,6 +159,7 @@ const gaPageIdentifier = Astro.url.pathname
|
|||||||
|
|
||||||
<Analytics />
|
<Analytics />
|
||||||
<Clarity />
|
<Clarity />
|
||||||
|
<RedditPixel />
|
||||||
</head>
|
</head>
|
||||||
<body class='flex min-h-screen flex-col'>
|
<body class='flex min-h-screen flex-col'>
|
||||||
<slot name='page-header'>
|
<slot name='page-header'>
|
||||||
|
Reference in New Issue
Block a user