kamalglb Posted August 25, 2016 Share Posted August 25, 2016 Hello All, I want to integrate Google analytics with WHMCS. As I need to be able to setup Google Analytics Cross Domain functionality. (My Product website is abc.com and WHMCS is hosted in def.com). So thing is the default google analytics addon won't work here, as the code snippet needs to have auto-linker tag. Also I found the best way to do will be with Google Tag Manager. Now when I try to add the script, which looks something like this: <!-- Google Tag Manager --> <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-KLC7XQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <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= '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-TagID');</script> <!-- End Google Tag Manager --> To the footer.tpl the buttons on WHMCS pages stop working, and if I add this to header.tpl the page css stops working. Now this is frustrating situation for me, as I want to track actual revenue am generating through my ad campaigns, and that can only be achieved with Google Analytics Ecommerce Tracking, but this way, I can't connect my website with the billing portal. So is there someone who can help me with this, or I will have to find a way to migrate the licenses of my client, as this situation is getting frustrating for me, support is also not helping here. Would really appreciate the suggestion of community members. 0 Quote Link to comment Share on other sites More sharing options...
zomex Posted August 27, 2016 Share Posted August 27, 2016 Hello, Although it's mentioned that this is no longer required in newer versions of WHMCS I've found that it is still required for some Javascript code. Try the following: <!-- Google Tag Manager --> <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-KLC7XQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> {literal} <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= '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-TagID');</script> {/literal} <!-- End Google Tag Manager --> Regards, Jack 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.