Skip to main content

Google Analytics (GA4)

Duncan from Memberstack
Duncan from Memberstack

This article will show you how to send the user_ID data to GA4.

This assumes you already added your Google ID in the Webflow integration settings, or to the site header. This code should go at the very bottom of your site's custom code. Before the closing </body> tag is usually best.   

 
  <script>

  window.$memberstackDom.getCurrentMember().then(({ data: member }) => {

  if (member) {

    let id = member.id;

    gtag('config', 'G-DX9XPTGR74', {

      'user_id': id
    });

  }

  });
  
</script>

It usually takes 24 hours to start registering data.

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

 

Was this article helpful?

Didn’t find your answer?

Get an instant answer from Rey, or reach a human. Either way, we’re happy to help.

Comments

2 comments

  • MJ Petroni
    MJ Petroni

    Should we be changing "G-DX9XPTGR74" shown in the code snippet to our own UA/GA code? 

    Thanks!

     

    0
  • Duncan from Memberstack
    Duncan from Memberstack Author

    Yup! Exactly. 

    0

Please sign in to leave a comment.

Sitemap