diff --git a/Context/WebContext.php b/Context/WebContext.php index a4b90d318..b89b7bc46 100644 --- a/Context/WebContext.php +++ b/Context/WebContext.php @@ -248,10 +248,12 @@ public function getInstallInstructions($container, $environment) $embedCode = << INST; diff --git a/TagManager.php b/TagManager.php index c620a063e..1fe18a407 100644 --- a/TagManager.php +++ b/TagManager.php @@ -867,6 +867,7 @@ public function getStylesheetFiles(&$stylesheets) $stylesheets[] = "plugins/TagManager/vue/src/ContainerSelector/ContainerSelector.less"; $stylesheets[] = "plugins/TagManager/vue/src/ContainerDashboard/ContainerDashboard.less"; $stylesheets[] = "plugins/TagManager/vue/src/Version/VersionEdit.less"; + $stylesheets[] = "plugins/TagManager/vue/src/TagmanagerTrackingCode/TagManagerTrackingCode.less"; } public function getJsFiles(&$jsFiles) diff --git a/tests/System/expected/test_dev_with_content__TagManager.getContainerEmbedCode.xml b/tests/System/expected/test_dev_with_content__TagManager.getContainerEmbedCode.xml index cb1ad55f1..fb9b0da56 100644 --- a/tests/System/expected/test_dev_with_content__TagManager.getContainerEmbedCode.xml +++ b/tests/System/expected/test_dev_with_content__TagManager.getContainerEmbedCode.xml @@ -1,9 +1,11 @@ <!-- Matomo Tag Manager --> <script> -var _mtm = window._mtm = window._mtm || []; -_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); -var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; -g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont1_dev_5145ce110dfb83505890f752.js'; s.parentNode.insertBefore(g,s); + var _mtm = window._mtm = window._mtm || []; + _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); + (function() { + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont1_dev_5145ce110dfb83505890f752.js'; s.parentNode.insertBefore(g,s); + })(); </script> <!-- End Matomo Tag Manager --> \ No newline at end of file diff --git a/tests/System/expected/test_dev_with_content__TagManager.getContainerInstallInstructions.xml b/tests/System/expected/test_dev_with_content__TagManager.getContainerInstallInstructions.xml index 217295ff3..f1745b98d 100644 --- a/tests/System/expected/test_dev_with_content__TagManager.getContainerInstallInstructions.xml +++ b/tests/System/expected/test_dev_with_content__TagManager.getContainerInstallInstructions.xml @@ -4,10 +4,12 @@ To install this container, copy / paste the following code as high as possible into the <head> part of every page of your site. <!-- Matomo Tag Manager --> <script> -var _mtm = window._mtm = window._mtm || []; -_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); -var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; -g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont1_dev_5145ce110dfb83505890f752.js'; s.parentNode.insertBefore(g,s); + var _mtm = window._mtm = window._mtm || []; + _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); + (function() { + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont1_dev_5145ce110dfb83505890f752.js'; s.parentNode.insertBefore(g,s); + })(); </script> <!-- End Matomo Tag Manager --> https://developer.matomo.org/guides/tagmanager/embedding diff --git a/tests/System/expected/test_live_with_content__TagManager.getContainerEmbedCode.xml b/tests/System/expected/test_live_with_content__TagManager.getContainerEmbedCode.xml index 48bd1787f..ce931b758 100644 --- a/tests/System/expected/test_live_with_content__TagManager.getContainerEmbedCode.xml +++ b/tests/System/expected/test_live_with_content__TagManager.getContainerEmbedCode.xml @@ -1,9 +1,11 @@ <!-- Matomo Tag Manager --> <script> -var _mtm = window._mtm = window._mtm || []; -_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); -var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; -g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont1.js'; s.parentNode.insertBefore(g,s); + var _mtm = window._mtm = window._mtm || []; + _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); + (function() { + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont1.js'; s.parentNode.insertBefore(g,s); + })(); </script> <!-- End Matomo Tag Manager --> \ No newline at end of file diff --git a/tests/System/expected/test_live_with_content__TagManager.getContainerInstallInstructions.xml b/tests/System/expected/test_live_with_content__TagManager.getContainerInstallInstructions.xml index c5b778e84..48c1de944 100644 --- a/tests/System/expected/test_live_with_content__TagManager.getContainerInstallInstructions.xml +++ b/tests/System/expected/test_live_with_content__TagManager.getContainerInstallInstructions.xml @@ -4,10 +4,12 @@ To install this container, copy / paste the following code as high as possible into the <head> part of every page of your site. <!-- Matomo Tag Manager --> <script> -var _mtm = window._mtm = window._mtm || []; -_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); -var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; -g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont1.js'; s.parentNode.insertBefore(g,s); + var _mtm = window._mtm = window._mtm || []; + _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); + (function() { + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont1.js'; s.parentNode.insertBefore(g,s); + })(); </script> <!-- End Matomo Tag Manager --> https://developer.matomo.org/guides/tagmanager/embedding diff --git a/tests/System/expected/test_no_such_release__TagManager.getContainerEmbedCode.xml b/tests/System/expected/test_no_such_release__TagManager.getContainerEmbedCode.xml index 364d22e19..0c5c8b1a8 100644 --- a/tests/System/expected/test_no_such_release__TagManager.getContainerEmbedCode.xml +++ b/tests/System/expected/test_no_such_release__TagManager.getContainerEmbedCode.xml @@ -1,9 +1,11 @@ <!-- Matomo Tag Manager --> <script> -var _mtm = window._mtm = window._mtm || []; -_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); -var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; -g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont2.js'; s.parentNode.insertBefore(g,s); + var _mtm = window._mtm = window._mtm || []; + _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); + (function() { + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont2.js'; s.parentNode.insertBefore(g,s); + })(); </script> <!-- End Matomo Tag Manager --> \ No newline at end of file diff --git a/tests/System/expected/test_no_such_release__TagManager.getContainerInstallInstructions.xml b/tests/System/expected/test_no_such_release__TagManager.getContainerInstallInstructions.xml index c0f05d130..3f35ef5bc 100644 --- a/tests/System/expected/test_no_such_release__TagManager.getContainerInstallInstructions.xml +++ b/tests/System/expected/test_no_such_release__TagManager.getContainerInstallInstructions.xml @@ -4,10 +4,12 @@ To install this container, copy / paste the following code as high as possible into the <head> part of every page of your site. <!-- Matomo Tag Manager --> <script> -var _mtm = window._mtm = window._mtm || []; -_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); -var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; -g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont2.js'; s.parentNode.insertBefore(g,s); + var _mtm = window._mtm = window._mtm || []; + _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); + (function() { + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont2.js'; s.parentNode.insertBefore(g,s); + })(); </script> <!-- End Matomo Tag Manager --> https://developer.matomo.org/guides/tagmanager/embedding diff --git a/tests/System/expected/test_stating_with_content__TagManager.getContainerEmbedCode.xml b/tests/System/expected/test_stating_with_content__TagManager.getContainerEmbedCode.xml index 532aa05cf..b081a03a5 100644 --- a/tests/System/expected/test_stating_with_content__TagManager.getContainerEmbedCode.xml +++ b/tests/System/expected/test_stating_with_content__TagManager.getContainerEmbedCode.xml @@ -1,9 +1,11 @@ <!-- Matomo Tag Manager --> <script> -var _mtm = window._mtm = window._mtm || []; -_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); -var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; -g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont1_staging_a7295f29fb160dcfb59d3193.js'; s.parentNode.insertBefore(g,s); + var _mtm = window._mtm = window._mtm || []; + _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); + (function() { + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont1_staging_a7295f29fb160dcfb59d3193.js'; s.parentNode.insertBefore(g,s); + })(); </script> <!-- End Matomo Tag Manager --> \ No newline at end of file diff --git a/tests/System/expected/test_stating_with_content__TagManager.getContainerInstallInstructions.xml b/tests/System/expected/test_stating_with_content__TagManager.getContainerInstallInstructions.xml index e38393fd8..fc387cc5a 100644 --- a/tests/System/expected/test_stating_with_content__TagManager.getContainerInstallInstructions.xml +++ b/tests/System/expected/test_stating_with_content__TagManager.getContainerInstallInstructions.xml @@ -4,10 +4,12 @@ To install this container, copy / paste the following code as high as possible into the <head> part of every page of your site. <!-- Matomo Tag Manager --> <script> -var _mtm = window._mtm = window._mtm || []; -_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); -var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; -g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont1_staging_a7295f29fb160dcfb59d3193.js'; s.parentNode.insertBefore(g,s); + var _mtm = window._mtm = window._mtm || []; + _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); + (function() { + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont1_staging_a7295f29fb160dcfb59d3193.js'; s.parentNode.insertBefore(g,s); + })(); </script> <!-- End Matomo Tag Manager --> https://developer.matomo.org/guides/tagmanager/embedding diff --git a/tests/System/expected/test_with_content__TagManager.getContainerEmbedCode.xml b/tests/System/expected/test_with_content__TagManager.getContainerEmbedCode.xml index 48bd1787f..ce931b758 100644 --- a/tests/System/expected/test_with_content__TagManager.getContainerEmbedCode.xml +++ b/tests/System/expected/test_with_content__TagManager.getContainerEmbedCode.xml @@ -1,9 +1,11 @@ <!-- Matomo Tag Manager --> <script> -var _mtm = window._mtm = window._mtm || []; -_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); -var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; -g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont1.js'; s.parentNode.insertBefore(g,s); + var _mtm = window._mtm = window._mtm || []; + _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); + (function() { + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont1.js'; s.parentNode.insertBefore(g,s); + })(); </script> <!-- End Matomo Tag Manager --> \ No newline at end of file diff --git a/tests/System/expected/test_with_content__TagManager.getContainerInstallInstructions.xml b/tests/System/expected/test_with_content__TagManager.getContainerInstallInstructions.xml index c5b778e84..48c1de944 100644 --- a/tests/System/expected/test_with_content__TagManager.getContainerInstallInstructions.xml +++ b/tests/System/expected/test_with_content__TagManager.getContainerInstallInstructions.xml @@ -4,10 +4,12 @@ To install this container, copy / paste the following code as high as possible into the <head> part of every page of your site. <!-- Matomo Tag Manager --> <script> -var _mtm = window._mtm = window._mtm || []; -_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); -var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; -g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont1.js'; s.parentNode.insertBefore(g,s); + var _mtm = window._mtm = window._mtm || []; + _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); + (function() { + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.async=true; g.src='http://example.com/piwik/tests/PHPUnit/proxy/js/container_aaacont1.js'; s.parentNode.insertBefore(g,s); + })(); </script> <!-- End Matomo Tag Manager --> https://developer.matomo.org/guides/tagmanager/embedding diff --git a/vue/src/TagmanagerTrackingCode/TagManagerTrackingCode.less b/vue/src/TagmanagerTrackingCode/TagManagerTrackingCode.less new file mode 100644 index 000000000..41543b5b3 --- /dev/null +++ b/vue/src/TagmanagerTrackingCode/TagManagerTrackingCode.less @@ -0,0 +1,11 @@ +div[anchor='tagmanager'] div[matomo-tagmanager-tracking-code] { + .list-style-decimal { + list-style-type: decimal; + list-style-position: inside; + } + + .tagManagerTrackingCode .row { + margin-bottom: 0rem !important; + margin-top: -0.5rem !important; + } +} \ No newline at end of file