I am just starting to dive into Tag Manager. I am using a small Wordpress installation for that. I changed the old piwik code for the Tag Manager code in the header. All works fine. However before I was able to track wordpress user ID’s via the Piwik plugin settings. I am not sure how do to the same via Tag Managers Matomo configuration.
The logged in user in Wordpress isn’t something that you can simply read via Javascript. You would need to modify Wordpress so it stores the username in a Javascript variable. (Which I think is what WP-Matomo does out of the box)
Maybe when @WP_PiwikDev or someone else has time to add Tag Manager support to WP-Matomo they could make it possible to set the User ID without the rest of the tracking code.
If you are using the Wordpress plugin, you can just enable the user tracking without changing the tracking code. Just have a look at WP-Matomo’s settings, tracking tab, and choose the user ID (mail address, WordPress user name, WP-User-ID, …) from the last select box shown there.
Afterwards WP-Matomo will set setUserId automatically.
Hi,
I am not sure I follow. I already did that and it works perfectly. However the tracking code field in the wp-matomo plugin contains my matomo tracking code, not the matomo tag manager code. I would like to use user id with the tag manager tracking code.