{"id":17777849,"date":"2024-05-24T07:03:48","date_gmt":"2024-05-24T07:03:48","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/duplicate-data-attribute\/"},"modified":"2024-05-24T07:03:48","modified_gmt":"2024-05-24T07:03:48","slug":"duplicate-data-attribute","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/duplicate-data-attribute\/","title":{"rendered":"Duplicate data-attribute"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hi, i have duplicate data-attribute tag in script for Hotjar and Google Tag Manager. This is what i do:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br \/><strong>For Hotjar<\/strong><\/p>\n\n\n\n<ul>\n<li>Added script through Integrations -&gt; Script Center -&gt; paste the script and choose category to statisctic<\/li>\n\n\n\n<li>Synced with the Cookiesdatabase in Wizard -&gt; Consent -&gt; cookiedatabase.org<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Then i check the DOM and see that the Hotjar script tag has duplicate data-attribute. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script data-service=\"hotjar\" <strong>data-category<\/strong>=\"marketing\" type=\"text\/plain\" <strong>data-category<\/strong>=\"statistics\"&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>For Google Tag<\/strong><\/p>\n\n\n\n<ul>\n<li>Added Google Tag ID in Wizard -&gt; Statistics Configuration -&gt; Google Tag &#8211; Statistics Field.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Then i check the DOM and see that the Google tag script tag has duplicate data-attribute. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script type=\"text\/plain\" data-service=\"google-analytics\" <strong>data-category<\/strong>=\"statistics\" async <strong>data-category<\/strong>=\"statistics\" data-cmplz-src=\"https:\/\/www.googletagmanager.com\/gtag\/js?id=XXXXXXXXXXXX\"&gt;&lt;\/script&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Any clue why is that happen? Thanks<\/p>\n","protected":false},"template":"","class_list":["post-17777849","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17777849","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17777849\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=17777849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}