hello and welcome to the Google analytics tutorial series I'm Matt Landers and in this tutorial we'll
learn about user properties we'll go over what they are and why they're valuable to you and
then we'll create and report on our own custom user property in a previous tutorial we saw how
events allow you to collect data about what people are doing on your website or app for
example you saw how to measure page views and button clicks through automatically collected
events and custom events these events are great for measuring user activity but it can also be
useful to understand the users who are interacting with your website or app so that you can segment
the data around these identifiers and make more sense of your users for example are certain age
groups engaging with your website or more often than others or are users from certain countries
interacting with certain pages more than other pages user properties can help you understand your
results better so that you can personalize your website or app and improve your user experience
the same way events populate dimensions and metrics in your reports user properties populate
dimensions and some of these dimensions are available for you automatically these
include what browser is being used the country device language platform region and more and
you can find a complete list of predefined user dimensions in the video description below alright
sometimes you want to group users into categories that are meaningful to your business but aren't
defined by Google for example let's say we want to know the role a user plays in their
Organization for our demo this could be broken down into marketers developers or business owners
we can enable our users to self-identify and save this as a user property this way we can
better curate our content to the different types of users when we include this event on a page
each event on the page will be associated with the user property value for example if someone
chooses developer instead of marketer the page view click and scroll events will all have a
job role user property associated with it that has a value of developer as a best practice we
recommend creating a range or a few values that user properties can have to make reporting easier
and so that you don't hit any cardinality limits for instance don't create a user property that
is unique for every user the goal is to group users into buckets that you can analyze and act
on it isn't a place to store information about an individual user now that we know a little
more about user properties let's jump over into our demo and set one up all right we're on the
home page of our demo site that we've been working on throughout this series and I've created a new
page a profile page so the user can go to their profile and they can select their job function
and they can just let business owner developer or marketer I'm an assistant Select developer and
then I can click submit now when the user makes that selection we want to save that selection onto
the user in Google analytics as a user property so there's a lot of different ways we could do
this we could use gtag which would make us have to go into our website and edit our code but I want
to show you a way to do this without editing your website at all we do have to write a little bit of
code so bear with me but it makes it really simple to just use GTM for everything so let's go ahead
and do that so we're going to go to GTM we're going to first create a variable and this is where
the coding comes in we'll create a new variable and we will create use custom JavaScript for this
and what we have to do is we just have to write a function and we call it get job function
and it just returns a value so it's going to return the value of the selection in the
drop down box and well how we can do that is we can use document.getelement by ID
the name of that drop down box or the slide box is job function and I'll show you that in a second
and then I can do dot value so I'm just returning the value that was
selected by the user so let's go over to our code real quick
and we'll see this select box here so the ID is job function that's what we're using the
JavaScript and the value will be the value here of whatever the user selected so in our case we
selected developer or whatever the user selects it's going to make it into that variable so
let's go back over to GTM and we'll see this is pretty straightforward we're grabbing the
document which is the web page we're getting it using git element by ID on a job function
and we're returning the value of whatever the user selected so let's call this variable job function
we'll save that and now what we want to do is we want to trigger whenever we should actually save
this so let's go ahead and create a trigger let's create a new form submission trigger
so we'll call it form submission and it's our profile form so we'll just put profile here
and we'll go down and we'll choose a new form submission now we've done this in
previous tutorials so I'm not going to dive into all the details here but we only want
this to happen on some forms and this is going to be our profile form so the form ID is called
profile form that's also in our HTML we'll save this and now we just need to go create a tag
so we'll go to our tags we'll create a new tag we're going to call this our ga4 event
if I can type and this is going to be our profile update event
so it's whenever the user updates their profile we're going to fire
this event it's going to trigger on that form submission of the profile
and we're just going to go configure this as a ga4 event we select our config just our default ga4
config that we created earlier in the series and then we're going to name this event just profile
update now in order to get it on the user properties all we have to do is go down
here to user properties add a row and we're going to call the user property job function
and then we're going to use the value for that will be the variable that we created job
function with that custom JavaScript we're going to save this and now we'll go to preview to make
sure everything's working so we'll click preview that allow us to open our website with our tag
assistant now we have our website open with tag assistant running which we've gone over this and
other tutorial videos as well on how tag assistant works so definitely check that out if you don't
know what this is but allows us to see all of the debug information that's happening as we click
around our site all right so go to profile we'll select let's just do business owner hit submit
and we'll go back over to tag assistant and let's see what happened so on our form submit we can see
that we have different variables we have business owner in our job function variable that we created
in GTM and if we click on our Google analytics tag so right now we're on our container if we click on
our Google analytics tag we can see that a profile update event was sent and if we scroll down to the
bottom here we'll see that the job function variable or user property was set to business
owner all right I know that might have been a lot but it was pretty simple to go in to GTM
grab the value out of that form and then add that to the user properties of an event so we created
a new event called profile update and that's just custom event that we're sending through
so we'll be able to analyze that in analytics as well and see how often users are updating their
profile and then we'll have that information on the user whenever they update their profile so
that we can use that job function to slice and dice in our reports and you know separate our
users based on their different job functions and see how they behave differently and how
maybe they convert differently as well so hopefully this gave you a good overview
on how user properties work how you can get them into the system and then use them in your reports
in order to see your users in different ways based on the properties that you set for them
all right thank you for running this tutorial series if you have any questions definitely
join our Discord Community where you can get answers from the community and sometimes from
googlers like myself and my team or jump in to answer your questions as well so join that
there's a link in the description and until our next series happy measuring