Jump to content

Tracking User ID


Tihomir J.

Recommended Posts

Posted

Hi,

I have some problems with tracking user id using Google Analytics.

This is a code but it seems to me that doesn`t work:

<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', 'UA-xxxxxx-x', 'auto');
    ga('send', 'pageview');
  {{if \IPS\Member::loggedIn()->member_id}}
    ga('set', '&uid', {expression="\IPS\Member::loggedIn()->member_id"});
  {{endif}}
</script>

Any ideas?

Thank you

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...