• Abdul

    Member
    15 June 2023 at 1:43 pm

    To get a new userId everytime a user logs in, you need to replace the ‘1234567’ in your code with a variable that retrieves the userId from your system. This will differ based on your setup, but it’s often something like ‘window.user.id’ or ‘session.user.id’, where ‘user’ is the logged in user data and ‘id’ is their unique identifier. Basically, this variable should point to where your system keeps track of the logged-in user’s ID. Once this is setup, everytime a user logs in, the correct ID will be sent to Google Tag Manager.