Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
2 + 9 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     

Re: Track Xoops user detail in Google Analytics
by kakos on 2022/11/16 7:08:29

You can paste it in the your theme. Look at header section where the rest of the javascripts are <script> .... </script>.
Re: Track Xoops user detail in Google Analytics
by JammerPro on 2022/11/11 5:02:35

Hi gentlemen... Well, Google has now taken Google Analytics to Version 4. We need to add more info like a "MEASUREMENT ID" and more. I forgot where I put the initial code with just the property number. Can someone please refresh where to paste

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-837489235V6NFake"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-837489235V6NFake');
</script>

Thanks in advance!
Re: Track Xoops user detail in Google Analytics
by xd9527 on 2018/2/5 1:49:44

thank you Mamba
can add GA code in system maybe next xoops vertion
like wordpress have this function
Re: Track Xoops user detail in Google Analytics
by Mamba on 2018/2/2 8:26:10

Thanks for sharing!

And you English is fine, so don't worry about it!
Track Xoops user detail in Google Analytics
by xd9527 on 2018/1/31 9:21:56

Step1. Enables GA User-ID
https://support.google.com/analytics/answer/3123662

Step2. Add Track code in your xoops template
use new track code (gtag.js)
le="color: #000000"><?php <script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_UAID"></script> <{if $xoops_isuser}> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'GA_TRACKING_UAID', { 'user_id': '<{$xoops_name}>' }); </script> <{else}> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'GA_TRACKING_UAID', { 'user_id': '<{$smarty.const._GUESTS}>' }); </script><{/if}>


if use old code (analytics.js)
le="color: #000000"><?php <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'GA_TRACKING_UAID', 'YOUR_DOMAIN_NAME'); <{if $xoops_isuser}> var xoopsuser_name = "<{$xoops_name}>"; ga('set', 'userId', xoopsuser_name ); <{/if}> ga('send', 'pageview'); </script>


Clear Template Cache
now you can track your xoops user log detail in Google Analytics

reference
https://developers.google.com/analytics/devguides/collection/gtagjs/migration
https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id
https://developers.google.com/analytics/devguides/collection/gtagjs/setting-values

Resized Image
Resized Image

thanks , i'm come from taiwan. (not china)
my english very pool , so embarrassed

My Blog
https://3q.9527.tw/103

Who's Online

108 user(s) are online (72 user(s) are browsing Support Forums)


Members: 0


Guests: 108


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits