Skip to content

Commit

Permalink
feat: change tracking script from leadfeeder to leadinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
Dejan Zec authored and Dejan Zec committed Aug 30, 2024
1 parent 499a04d commit 41c31a7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 33 deletions.
31 changes: 0 additions & 31 deletions src/components/layout/leadfeeder-script.tsx

This file was deleted.

22 changes: 22 additions & 0 deletions src/components/layout/leadinfo-script.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { useEffect } from 'react';

const LeadinfoScript = () => {
useEffect(() => {
const script = document.createElement('script');
script.innerHTML = `
(function(l,e,a,d,i,n,f,o){if(!l[i]){l.GlobalLeadinfoNamespace=l.GlobalLeadinfoNamespace||[];
l.GlobalLeadinfoNamespace.push(i);l[i]=function(){(l[i].q=l[i].q||[]).push(arguments)};l[i].t=l[i].t||n;
l[i].q=l[i].q||[];o=e.createElement(a);f=e.getElementsByTagName(a)[0];o.async=1;o.src=d;f.parentNode.insertBefore(o,f);}
}(window,document,'script','https://cdn.leadinfo.eu/ping.js','leadinfo','LI-66D184CC97CFD'));
`;
document.head.appendChild(script);

return () => {
document.head.removeChild(script);
};
}, []);

return null;
};

export default LeadinfoScript;
4 changes: 2 additions & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from '../types';
import { IGatsbyImageData } from 'gatsby-plugin-image';
import { StructuredOrganizationData } from '../components/pages/landingpage/structured-organization-data';
import LeadfeederScript from '../components/layout/leadfeeder-script'; // Import the new component
import LeadinfoScript from '../components/layout/leadinfo-script'; // Import the new component

export interface OfficeImage {
relativePath: string;
Expand Down Expand Up @@ -73,7 +73,7 @@ export const Head = ({ data, location }: PageProps<IndexPageQueryProps>) => {
locales={data.locales}
/>
<StructuredOrganizationData />
<LeadfeederScript />
<LeadinfoScript />
</>
);
};
Expand Down

0 comments on commit 41c31a7

Please sign in to comment.