Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2335 Lượt xem

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 ';'


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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...



Ảnh đại diện
Huỷ bỏ
Tác giả

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>
`

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 5 25
709
3
thg 5 25
1979