Develop
This commit is contained in:
parent
3062368f9b
commit
e7ce6f68dd
@ -1,4 +1,4 @@
|
|||||||
import { language } from "@/locales";
|
import { getDefaultLocaleByLanguage, language } from "@/locales";
|
||||||
import routes from "@/routes";
|
import routes from "@/routes";
|
||||||
import { Helmet } from "react-helmet";
|
import { Helmet } from "react-helmet";
|
||||||
|
|
||||||
@ -19,6 +19,8 @@ const isRouteInclude = (url: string, routes: string[]) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const MetaPixel = () => {
|
const MetaPixel = () => {
|
||||||
|
const locale = getDefaultLocaleByLanguage(language);
|
||||||
|
|
||||||
let FBScript = `!function(f,b,e,v,n,t,s)
|
let FBScript = `!function(f,b,e,v,n,t,s)
|
||||||
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
|
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
|
||||||
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
|
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
|
||||||
@ -53,6 +55,18 @@ t.src=v;s=b.getElementsByTagName(e)[0];
|
|||||||
s.parentNode.insertBefore(t,s)}(window, document,'script',
|
s.parentNode.insertBefore(t,s)}(window, document,'script',
|
||||||
'https://connect.facebook.net/en_US/fbevents.js');
|
'https://connect.facebook.net/en_US/fbevents.js');
|
||||||
fbq('init', '1668062363756364');
|
fbq('init', '1668062363756364');
|
||||||
|
fbq('track', 'PageView');`;
|
||||||
|
|
||||||
|
const FBScriptES = `
|
||||||
|
!function(f,b,e,v,n,t,s)
|
||||||
|
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
|
||||||
|
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
|
||||||
|
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
|
||||||
|
n.queue=[];t=b.createElement(e);t.async=!0;
|
||||||
|
t.src=v;s=b.getElementsByTagName(e)[0];
|
||||||
|
s.parentNode.insertBefore(t,s)}(window, document,'script',
|
||||||
|
'https://connect.facebook.net/en_US/fbevents.js');
|
||||||
|
fbq('init', '3877906525820865');
|
||||||
fbq('track', 'PageView');`;
|
fbq('track', 'PageView');`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -61,6 +75,7 @@ fbq('track', 'PageView');`;
|
|||||||
{isRouteInclude(window.location.href, routesPalmistry) && (
|
{isRouteInclude(window.location.href, routesPalmistry) && (
|
||||||
<script>{FBScriptPalmistry2}</script>
|
<script>{FBScriptPalmistry2}</script>
|
||||||
)}
|
)}
|
||||||
|
{locale === "es" && <script>{FBScriptES}</script>}
|
||||||
</Helmet>
|
</Helmet>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user