[Wishlist] Google Analytics - GA4 Answered

Hello, Would it be possible to send the user_ID data to GA4 as it is currently possible with the current Google analytics version (UA) ? Thanks, William

Comments

5 comments

  • Comment author
    Duncan from Memberstack
    • Edited

    Hey William 👋

    I would imagine so... 

    To be 1000% transparent I used ChatGPT to write this code 🤣 Can you give it a try for me?

    This assumes you've already added your Google ID in the Webflow integration settings, or to the site header. This code should go at the very bottom of the page. 

    <script>
    window.$memberstackDom.getCurrentMember().then(({ data: member }) => {
      if (member) {
        let id = member.id;

        gtag('config', 'G-DX9XPTGR74', {
          'user_id': id
      });
      }
    });
    </script>

    I've set it up on my end, and I could only run reports on the data after 24 hours. 

    Here's a quick video to show you how to run reports on users with an ID

    1
  • Comment author
    Duncan from Memberstack

    William de Broucker I just cleaned up this thread so it's easy for future readers.

    Can you try the updated code above for me? And watch that video too. This updated code seems to be working for me 🎉

    0
  • Comment author
    William de Broucker

    Great let me test it :) 

    0
  • Comment author
    William de Broucker

    I tried with my own Google tag but it doesn't work :'( 

    0
  • Comment author
    Duncan from Memberstack

    It took mine 24 hours to start registering data. 👍 Hopefully that's the case for yours as well

    0

Please sign in to leave a comment.