Skip to Content
Menu
This question has been flagged
1 Reply
1818 Views

Hello everyone, 

We are trying to implement the code from Google Tag Manager on our website. From what I could find on the forum I saw that we should paste the code in the head section of the "Web Layout" page in the website builder, however when I do this I get the following error message and I can't find anything on internet about it. 

I know there are addons on the store to facilitate this however we are willing to stay on Odoo Saas and avoid going on .sh

error message we get:  error on line 18 at column 51: EntityRef: expecting ';'


Avatar
Discard
Best Answer

You need to escape the  into  when you use html editor since it is xml.


You can also just use the theme > Website Settings > Code Injection > Head  option to do it...


In recent version (since v15?), it is already googletagmanager by default when you use google analytics...



Avatar
Discard
Author

Thanks a lot !
It worked :) I changed the & with &amp which made it possible to save :)
We are on v16 and I did not find anything related to tag manager by default in this version. (maybe I did not know where to look for)

Website > Settings > Google Analytics

And it will automatically add this code in your page

<script id="tracking_code" async="1" src="https://www.googletagmanager.com/gtag/js?id=G-XXYYZZ"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXYYZZ');
</script>
`

Related Posts Replies Views Activity
0
May 25
168
3
May 25
1265