Support » Plugin: GTM4WP - A Google Tag Manager (GTM) plugin for WordPress » Track User ID in Google Analytics

  • Hello

    I have a problem with display properly an user ID in dataLayer and show users in Google Analytics dashboard (UserID view).

    I have enabled these two tracking options in Widget settings:
    Basic data/Visitors/Logged in status and user ID

    Code on my website:
    <!– Google Tag Manager for WordPress by gtm4wp.com –>
    <script data-cfasync=”false” type=”text/javascript”>//<![CDATA[
    var gtm4wp_datalayer_name = “dataLayer”;
    var dataLayer = dataLayer || [];
    //]]>
    </script>

    “[]” is blank after being logged in Worpdress. How to display UserID there?

    Kindest Regards
    Sebastian

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi Sebastian,

    This is just the first part of the code that the plugin adds to your site. If you search for other dataLayer.push( instances, you will find the push that adds the user id with the variable name visitorId.

    Thread Starter sebastianfr

    (@sebastianfr)

    Hello

    Thank you, I found part of the code.

    But in Google Analaytics (user ID view), users online are not visible (zero).

    Can you please provide how to configure this plugin properly for “User ID” functionality? (also in Google Tag Manager).

    Kindest Regards
    RK

    Thread Starter sebastianfr

    (@sebastianfr)

    I have fixed this by adding “visitorId” layer variable in Google Tag Manager.

    Is there a way to track goals? e.g. in submit forms? (show them in User ID user explorator)
    e.g. after click on <button type=”submit” class=”c-btn no-border”>Wyślij</button>

    And more e-commerce data like specific product views (I’ve enabled e-commerce tracking).

    Regards
    Sebastian

    Thread Starter sebastianfr

    (@sebastianfr)

    To include these data I have to add another layers in Google Tag Manager or just enable them in plugin options? “Here you can check what data is needed to be included in the dataLayer to be able to access them in Google Tag Manager”

    Thread Starter sebastianfr

    (@sebastianfr)

    Regarding event tracking, after adding a tracking code to button:
    “<button onclick=”ga(‘send’, ‘event’, ‘button’, ‘formularz b2b’, ‘formularz b2b – wyslij’);” type=”submit” class=”c-btn no-border”>Send</button>”

    Events are not tracking in Google Analytics User-ID view. Why?

    Kindest Regards
    Sebastian

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi Sebastian,

    Could you post the URL of your site so that I can see what is happening there?
    Normally you should activate the visitor ID plugin option and then read this with a Data Layer Variable and then pass this to your GA settings variable. I am using this setup on several sites.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Track User ID in Google Analytics’ is closed to new replies.