File tree 2 files changed +45
-0
lines changed 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import '@/styles/tailwind.css'
2
2
import localFont from 'next/font/local'
3
3
import Script from 'next/script'
4
4
import { googleAdsScript } from '@/scripts/google-ads'
5
+ import { linkedinTrackingScript } from '@/scripts/linkedin-tracking'
5
6
import MixpanelProvider from '@/components/MixpanelProvider'
6
7
7
8
// Load Switzer font files locally for optimal performance
@@ -129,9 +130,30 @@ export default function RootLayout({ children }) {
129
130
__html : googleAdsScript . configScript
130
131
} }
131
132
/>
133
+
134
+ { /* LinkedIn tracking script */ }
135
+ < Script
136
+ id = "linkedin-tracking"
137
+ strategy = "afterInteractive"
138
+ dangerouslySetInnerHTML = { {
139
+ __html : linkedinTrackingScript . script
140
+ } }
141
+ />
142
+
132
143
< body className = "text-gray-950 antialiased" >
133
144
< MixpanelProvider />
134
145
{ children }
146
+
147
+ { /* LinkedIn fallback for users with JavaScript disabled */ }
148
+ < noscript >
149
+ < img
150
+ height = "1"
151
+ width = "1"
152
+ style = { { display : 'none' } }
153
+ alt = ""
154
+ src = { linkedinTrackingScript . noscriptImg }
155
+ />
156
+ </ noscript >
135
157
</ body >
136
158
</ html >
137
159
)
Original file line number Diff line number Diff line change
1
+ /**
2
+ * LinkedIn Tracking Script
3
+ * This file contains the LinkedIn tracking script for conversion tracking
4
+ * and remarketing functionality across the site.
5
+ */
6
+
7
+ export const linkedinTrackingScript = {
8
+ script : `
9
+ _linkedin_partner_id = "8178713";
10
+ window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || [];
11
+ window._linkedin_data_partner_ids.push(_linkedin_partner_id);
12
+
13
+ (function(l) {
14
+ if (!l){window.lintrk = function(a,b){window.lintrk.q.push([a,b])};
15
+ window.lintrk.q=[]}
16
+ var s = document.getElementsByTagName("script")[0];
17
+ var b = document.createElement("script");
18
+ b.type = "text/javascript";b.async = true;
19
+ b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js";
20
+ s.parentNode.insertBefore(b, s);})(window.lintrk);
21
+ ` ,
22
+ noscriptImg : "https://px.ads.linkedin.com/collect/?pid=8178713&fmt=gif"
23
+ } ;
You can’t perform that action at this time.
0 commit comments