How do I setup visitor variables in Google Analytics?

by domenico.weimann , in category: SEO Tools , 2 years ago

How do I setup visitor variables in Google Analytics?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

2 answers

Member

by terrence , 2 years 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.

by dejuan.watsica , a year ago

@domenico.weimann 

Here are the steps to set up visitor variables using custom dimensions or custom metrics in Google Analytics:

  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" or "Custom Metrics" depending on whether you want to set up a dimension or a metric.
  4. Click on "+ New Custom Dimension" or "+ New Custom Metric" to create a new dimension or metric respectively.
  5. Give the dimension or metric a name that represents the variable you want to track.
  6. Choose the scope of the dimension or metric. The scope defines to what level the variable will be applied: user-level, session-level, or hit-level. Choose the appropriate scope based on your tracking requirements.
  7. Set any additional options or settings, such as formatting, that may be available for the dimension or metric.
  8. Click on "Create" to create the custom dimension or metric.


Once you have created the custom dimension or metric, you will need to update your Google Analytics tracking code to include the appropriate parameters. You can use the "ga('set')" method to set the value of the custom dimension or metric for a specific user or session. For example:

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


This code sets the value of the custom dimension with index 1 to "Paid User" for the current user or session. Replace "dimension1" with the actual index of your custom dimension or metric.


After setting up visitor variables, you can use them in your Google Analytics reports to segment and analyze the data based on these variables.