How do I setup visitor variables in Google Analytics?

by domenico.weimann , in category: SEO Tools , 7 months ago

How do I setup visitor variables in Google Analytics?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

Member

by terrence , 7 months ago

@domenico.weimann 

To set up visitor variables in Google Analytics, you will need to use custom dimensions or custom metrics.


Custom dimensions are used to define additional attributes of a user, session, or hit, that you want to track in addition to the default dimensions provided by Google Analytics. Custom dimensions allow you to segment your visitors based on your specific business needs. To create a custom dimension, follow these steps:

  1. Log in to your Google Analytics account and select the relevant property.
  2. Click on "Admin" in the bottom left-hand corner.
  3. Under the "Property" column, click on "Custom Definitions" and then click on "Custom Dimensions."
  4. Click on "+ New Custom Dimension."
  5. Give the dimension a name and select the scope of the dimension (user, session, or hit).
  6. Click on "Create" to create the dimension.


Custom metrics, on the other hand, are used to track additional quantitative data related to user interactions on your website. Custom metrics allow you to track specific business metrics, such as the number of times a certain button was clicked or the duration of time a user spent on a particular page. To create a custom metric, follow these steps:

  1. Log in to your Google Analytics account and select the relevant property.
  2. Click on "Admin" in the bottom left-hand corner.
  3. Under the "Property" column, click on "Custom Definitions" and then click on "Custom Metrics."
  4. Click on "+ New Custom Metric."
  5. Give the metric a name, select the type of metric, and set the formatting.
  6. Click on "Create" to create the metric.


Once you have created your custom dimensions or metrics, you can start tracking them by updating your tracking code to include the appropriate parameters. For example, if you have created a custom dimension called "User Type," you can set the value of this dimension by adding the following code to your tracking script:


ga('set', 'dimension1', 'Paid User');


This code will set the value of the "User Type" dimension to "Paid User" for the current user. You can then use this dimension to segment your visitors in your Google Analytics reports.