想來玩玩Google Tag Manager
但是安裝在Blogger的時候一直出現『XML error: The reference to entity "l" must end with the ';' delimiter.』的錯誤!
所幸找到解決辦法
決定還是紀錄一下~
感謝通達人驛站的翻譯稿
原文連結:http://www.prudentman.idv.tw/2014/12/resolve-google-tag-manager-xml-error.html
I am trying to integrate Google Tag Manager trace code into Blogger, but getting the XML error: The reference to entity "l" must end with the ';' delimiter.
我試著把 Google Tag Manager 的 trace code 整合在 Blogger 內,但出現了 XML error: The reference to entity "l" must end with the ';' delimiter.。
以下是 Google Tag Manager 提供的 trace code
Solution 解決方法
After Google, I found an ampersand "&l" which hasn't been escaped properly from trace code. From the DTD (Document Type Definition), it suggests that we might use an entity as 3 parts: "&", "entity name", and ";", namely &l;.
在 Google 後,我發現原來 Google Tag Manager 的 trace code 內的 &l 寫法並未正確的逃脫,以 DTD 的要求來說,一個實體是由三個部份組成:一個和號 (&)、一個實體名稱、以及一個分號 (;),所以 &l 必須寫成 &l;。
But even I used the $l; which comply the regular of DTD, the XML error message still happen. After I change to use "&l", it works.
但我發現即使改用了 DTD 建議的寫法:$l;,還是出現了相同的錯誤。後來我改用了畸型的寫法 &l 竟然就正常了。
Frankly, I really don't know why. It just works.
老實說,我還是不知道為什麼,但它就是有用!
但是安裝在Blogger的時候一直出現『XML error: The reference to entity "l" must end with the ';' delimiter.』的錯誤!
所幸找到解決辦法
決定還是紀錄一下~
感謝通達人驛站的翻譯稿
原文連結:http://www.prudentman.idv.tw/2014/12/resolve-google-tag-manager-xml-error.html
I am trying to integrate Google Tag Manager trace code into Blogger, but getting the XML error: The reference to entity "l" must end with the ';' delimiter.
我試著把 Google Tag Manager 的 trace code 整合在 Blogger 內,但出現了 XML error: The reference to entity "l" must end with the ';' delimiter.。
以下是 Google Tag Manager 提供的 trace code
<!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-XXXXXXX');</script> <!-- End Google Tag Manager -->
Solution 解決方法
After Google, I found an ampersand "&l" which hasn't been escaped properly from trace code. From the DTD (Document Type Definition), it suggests that we might use an entity as 3 parts: "&", "entity name", and ";", namely &l;.
在 Google 後,我發現原來 Google Tag Manager 的 trace code 內的 &l 寫法並未正確的逃脫,以 DTD 的要求來說,一個實體是由三個部份組成:一個和號 (&)、一個實體名稱、以及一個分號 (;),所以 &l 必須寫成 &l;。
But even I used the $l; which comply the regular of DTD, the XML error message still happen. After I change to use "&l", it works.
但我發現即使改用了 DTD 建議的寫法:$l;,還是出現了相同的錯誤。後來我改用了畸型的寫法 &l 竟然就正常了。
Frankly, I really don't know why. It just works.
老實說,我還是不知道為什麼,但它就是有用!
沒有留言:
張貼留言