Hello! I’m hoping someone can help and see what I don’t see with this. We’re trying to track a User Role variable for each user session as a custom dimension. The issue is, even thought it seems to be working, the custom dimension vs sessions report shows mostly No Data for the totals.
This would make sense if it was capturing instances where events did not have User Role populated, but I would expect the number of Sessions to reflect the User Roles tracked. But, it’s only 88 tracked User Roles of the 2117 Sessions in this example period. (Note: Unverified is the title of a User Role)
Here’s the steps I followed to set this up:
- We’re manually pushing the User Role to the dataLayer per these instructions. I do see it coming through on each page with every session we’ve tested. There’s always 1 of 3 user roles in place depending on the user:
- Custom Dimension (session dimension) was created as User Role and added to the Piwik PRO tag with the Dimension Value of
{{ User Role }}
:
- Variable called
User Role
was created with the Data layer variable name of userRole
:
- Tag was created with Dimension value of {{ User Role }} was created with an All Page Views trigger. Consent is not enforced on this site.
- Custom report was created to show User Role against other metrics shown here:
Any ideas why the User Role values are so low in the report when there’s so many sessions?
Hi @jasonatetr,
I’d start with creating a report that displays visitor IDs for sessions in which this session custom dimension was missing. You can then use the visitor ID in the session log and check if you see anything suspicious in those session (e.g. some pages don’t are missing the DL variable).
Edit: by the way, you can send the website URL (either here or in a private message), so I can snoop around and check the tracking after the weekend .
Thanks so much @anthonybartczak — I set up the report with Visitor IDs and, while I didn’t find anything conclusive, it did provide some insights. I still need to continue investigating but here’s an update:
I did find that the pre-login state is being capture for all users as “no data” which would make sense. All users hit https://providerportal.vnshealthplans.org
, are redirected to log in, and then return to the same domain/URL where it does display the custom dimension. That helps with some of the listings as almost everything logs in that way.
One question: Should the trigger be based on a dataLayer event of userRole
appearing rather than All Page Views? I’m wondering if the other “No Data” listings could be the other dataLayer events taking place before/after?:
The safest way (in my opinion) is to trigger the tag with the event that contains the specific variable as in that case you can safely assume that the current variable value was sent with the event. But in this case you’d also have to add and event
variable next to the userRole
(e.g. "event": "userRoleAssigned"
so the Tag Manager could read it.
That said, Piwik PRO Tag Manager should still retrieve the value from a dataLayer variable, even though the event itself appeared before the current event.