I am trying to add Google code for remarketing tag in
catalog/view/theme/*/template/common/footer.tplfor use in an Opencart project.
I have created this vQmod
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id>Add Google Code for Remarketing Tag in footer</id>
<version>1.0</version>
<vqmver required="true">2.4.0</vqmver>
<author>nbran@kanenas.net</author>
<file name="catalog/view/theme/*/template/common/footer.tpl">
<operation>
<search position="before" offset="0">
<![CDATA[</body>]]>
</search>
<add><![CDATA[
<script type="text/javascript">
var google_conversion_id = XXXXXXXXX;
var google_custom_params = window.google_tag_params;
var google_remarketing_only = true;
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/XXXXXXXXX/?value=0&guid=ON&script=0"/>
</div>
</noscript>
]]></add>
</operation>
</file>
</modification>
which works with one little problem. Tag Assisant (by Google) is complaining (as a minor issue) about "Missing CDATA comments" meaning this
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = XXXXXXXXX;
var google_custom_params = window.google_tag_params;
var google_remarketing_only = true;
/* ]]> */
</script>
which already contains CDATA.
Is there a way to "escape" CDATA inside CDATA in vQmod?
Thank you!
I am posting this as a workaround, but i will not accept it for a few days in case someone has to suggest something.
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id>Add Google code for remarketing tag in footer</id>
<version>1.0</version>
<vqmver required="true">2.4.0</vqmver>
<author>nbran@kanenas.net</author>
<file name="catalog/view/theme/*/template/common/footer.tpl">
<operation>
<search position="before" offset="0">
<![CDATA[</body>]]>
</search>
<add><![CDATA[
<script type="text/javascript">
/* ]]><![CDATA[ */
var google_conversion_id = XXXXXXXXX;
var google_custom_params = window.google_tag_params;
var google_remarketing_only = true;
/* ]]><![CDATA[ */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"></script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/XXXXXXXXX/?value=0&guid=ON&script=0"/>
</div>
</noscript>
]]></add>
</operation>
</file>
</modification>