Google Analytics (GA4)

Article author
Duncan Hamra

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

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 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?

Comments

2 comments

  • Comment author
    MJ Petroni

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

    Thanks!

     

    0
  • Comment author
    Duncan Hamra

    Yup! Exactly. 

    0

Please sign in to leave a comment.