You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

31 lines
1.4 KiB

<?xml version="1.0" encoding="utf-8"?>
<!-- custom_assets.xml -->
<odoo>
<template id="pixel_template_inherit_web_layout" name="Pixel Template"
inherit_id="web.layout">
<xpath expr="//head" position="inside">
<t t-set="pix_id"
t-value="request.env['ir.config_parameter'].sudo().get_param('pixel_id')"/>
<t t-if="pix_id">
<script>
var myVariable =<t t-esc="pix_id"/>;
!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', myVariable);
fbq('track', 'PageView');
</script>
<noscript>
<img height="1" width="1" style="display:none"
t-att-src="'https://www.facebook.com/tr?id=' + (pix_id or '') + '&amp;ev=PageView&amp;noscript=1'"
/>
</noscript>
</t>
</xpath>
</template>
</odoo>