Skip to content

Commit 5af521d

Browse files
authored
Added comment for the config Public ID field
1 parent c42edc5 commit 5af521d

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

etc/adminhtml/system.xml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,25 @@
2828
</field>
2929
<field id="public_id" translate="label comment" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
3030
<label>Public ID</label>
31-
<comment>E.g. GTM-XXXXXXX</comment>
31+
<comment><![CDATA[
32+
E.g. <strong>GTM-XXXXXXX</strong><br/>
33+
Please note that we do not allow pasting the GTM JavaScript code directly for security reasons. Public ID is used to automatically insert the GTM code to your pages:
34+
<pre>
35+
&lt;!-- Google Tag Manager --&gt;
36+
&lt;script&gt;(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({&#39;gtm.start&#39;:
37+
new Date().getTime(),event:&#39;gtm.js&#39;});var f=d.getElementsByTagName(s)[0],
38+
j=d.createElement(s),dl=l!=&#39;dataLayer&#39;?&#39;&amp;l=&#39;+l:&#39;&#39;;j.async=true;j.src=
39+
&#39;https://www.googletagmanager.com/gtm.js?id=&#39;+i+dl;f.parentNode.insertBefore(j,f);
40+
})(window,document,&#39;script&#39;,&#39;dataLayer&#39;,&#39;<strong>GTM-XXXXXXX</strong>&#39;);&lt;/script&gt;
41+
&lt;!-- End Google Tag Manager --&gt;
42+
</pre>
43+
<pre>
44+
&lt;!-- Google Tag Manager (noscript) --&gt;
45+
&lt;noscript&gt;&lt;iframe src=&quot;https://www.googletagmanager.com/ns.html?id=<strong>GTM-XXXXXXX</strong>&quot;
46+
height=&quot;0&quot; width=&quot;0&quot; style=&quot;display:none;visibility:hidden&quot;&gt;&lt;/iframe&gt;&lt;/noscript&gt;
47+
&lt;!-- End Google Tag Manager (noscript) --&gt;
48+
</pre>
49+
]]></comment>
3250
</field>
3351
<field id="account_id" translate="label comment" type="text" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
3452
<label>Account ID</label>

0 commit comments

Comments
 (0)