Special parameters and indicators. Create and edit custom dimensions and metrics Google Analytics Custom Metric

January 29, 2018

There are a large number of standard ones in Google Analytics: source/medium, city, device type, sessions, bounce rate, revenue, transactions, cost, conversion rate, browsers, gender, age, etc.

However, in practice there are often tasks in which it is necessary to monitor additional parameters of user interaction that go far beyond the scope of the current functionality.

For example, for an online store, it is necessary to correctly calculate profitability taking into account the cost of goods. There is no indicator in Google Analytics "Product cost". Or compare statistics for each of the authors of your blog or news resource to see all the necessary information in one table (how much traffic the articles of an individual author bring, how many of his articles are read on average per session, bounce rate, etc.). There is no Author option in Analytics. Or we have the task of identifying a “sales leader” based on online consultations on the site and rewarding him with an additional bonus for the revenue made this month. Standard Google Analytics reports do not contain such data.

All of the above examples and a number of others can be solved using special parameters and indicators.

Custom definitions (custom dimensions, custom dimensions and metrics, custom dimensions, etc) are variables that are not included in standard Google Analytics reports. They are part of Universal Analytics and are created manually by users to solve their own problems.

Using them, you can import data that Google Analytics does not collect by default: data on phone calls, from CRM, by authorized users, etc. and associate them with specific GA metrics.

Custom definitions are created at the resource level and have a number of limitations:

  • no more than 20 special parameters and 20 special indicators are available for each resource;
  • special parameters cannot be deleted, they can only be disabled;
  • they are only available in those resources that use Universal Analytics. With the old library js will not work.

To add a custom dimension in Analytics:

  • open the section "Administrator" and select the required resource;
  • in column "Resource" click "Custom Definitions - Custom Parameters" or "Custom Metrics".

Resource - Custom Definitions

  • click the button “+ Special parameter” (or indicator)

Creating a Custom Metric

For special parameters, the following settings are specified:

  • Name– the name of the special parameter in Google Analytics reports;
  • Scope– determines which hits the special parameter will apply to (Hit, Session, User and Product).
  • Active– indicates whether the value of the special parameter will be processed. Inactive custom parameters will appear in reports, but their values ​​will not be processed.

The scope determines which hits will be associated with a specific custom parameter value. There are four in total: appeal, session, user And product:

  • Appeal (hit)– the value applies only to the request for which it was specified;
  • Session– the value applies to all calls in the session (until 30 minutes of user inactivity have passed);
  • User– the value applies to all hits in the current session and future sessions until it changes or until the parameter is no longer active;
  • Product– the value will be applied to a specific product on your site (requires installation of advanced e-commerce).

Adding a Custom Parameter

Appeal (hit): session, % of new sessions, bounce rate, average session duration.

Examples of standard metrics with scope Product: average price, unique purchases, transactions, return amount for the product,

The following settings are specified for special indicators:

  • Name– the name of the special indicator in Google Analytics reports;
  • Scope— determines which requests a special indicator (Hit or Product) will be applied to.
  • Formatting type– format of a special indicator (integer number, currency, time is specified in seconds, displayed in reports as HH:MM:SS);
  • Maximum/minimum value (optional)– minimum and maximum values ​​that will be processed and entered into reports;
  • Active– indicates whether the value of a special indicator will be processed. Inactive custom measures will appear in reports, but their values ​​will not be processed.

Adding a Custom Metric

In addition to these settings, special indicators and parameters have several additional characteristics:

Additional characteristics of special indicators

  • Index – a unique identifier that Google Analytics uses to distinguish one dimension/metric from another. The value is an integer, from 1 to 20. This is the number you will use in the library js to send data about a specific indicator or parameter;
  • Last change - The date the custom dimension/metric was created or modified.

Note: As we learned earlier, not all standard parameters and indicators can be used with each other. This limitation also applies to custom definitions.

There are several ways to send data to Google Analytics:

  • via tracking code;
  • via Google Tag Manager;
  • through .

The last two methods within of this material are purposefully omitted; a separate series of articles will be devoted to them. Let's create a custom parameter:

Create a custom parameter

After saving the basic settings, a code fragment will become available, which will need to be inserted into certain pages of the site or application.

The number “1” (underlined in green) is the unique index that Analytics uses to distinguish one metric from another. Under no circumstances should it be changed when adding code to site pages, since no data will be collected.

Google Analytics offers us a choice of two codes for the parameter:

  1. global library site tag gtag.js

Instructions for setting up custom metrics using gtag.js presented at the link: https://developers.google.com/analytics/devguides/collection/gtagjs/custom-dims-mets

  1. traditional JavaScript (for resources that use Universal Analytics)

Pass special parameters and indicators with all requests on this page you can use the command set(as in the example above).

ga('set', 'dimension1', dimensionValue);

  • ga(‘set')– this is a command to set a parameter;
  • dimension– service designation of the parameter in Google Analytics, it cannot be changed;
  • 1 – unique index;
  • dimensionValue– value of the special parameter.

Set values ​​using command set For both parameter and indicator you can do this:

Tracking code using the set command

Similar variables in a special indicator, only instead of dimension And dimensionValue another function word is used metric. metricValue can be an integer, currency and time in seconds.

Tracking code for custom metrics

Pass special parameters for type inversion page view (pageview) you can do this:

Code for a page view type request

Pass special indicators for type invocation event (event) can be done as follows:

Code for event type call

In the first option (using the command set) the value is sent for all calls that will be called after the value is set. In the second option, values ​​are transmitted only for those calls where they are listed.

Learn more about custom dimensions and metrics in the official Google Developer Help.

Important! Line ga ('set') is always placed before the page view is sent, and setting any value via set must be executed before calling send.

As an example, let's create a special indicator "Product cost" for our online store and import data about it using a table.csv. In this case, advanced e-commerce must be installed on the site.

Its settings are as follows:

  • Name: cost of goods
  • Scope: product
  • Formatting type: currency (decimal format)
  • Maximum/minimum value: do not fill out
  • Status: active

Go to the section "Data Import". Let's create a new set of available types let's choose “Import of extended data – Product data”.

Data import - Product data

Enter a name and select a view that will use the data from this set.

Purpose of the pair “Key - Imported data”

To import product cost data, you need two parameters in pairs "key-value":

  • "Product ID"- key specified by the system by default based on the selected data set type;
  • "Product cost"— a special indicator that must be selected from the drop-down list.

Analytics asks us to redefine the data (overwrite it). If selected YES, then it will use the imported data, that is, the old ones cannot be restored.

) are excellent for most users. However, the ESA solution can also use custom delivery parameters.

Open the ESA Management Console on your host computer, navigate to your domain host (acswin2012.com in our example), click Advanced Settings ( Additional settings), and then click Delivery Options.

Here you can specify the path to the custom script (or find it by clicking the button) with which you want to prepare or deliver the OTP password. Click to display a list of parameters that can be passed to the custom script. For example, to deliver a one-time password (OTP), you need to use the parameter. In addition, you can pass a custom string into the script, which you need to specify for this (see parameter1 in the screenshot above).

Sample Script - Password Delivery OTP by email

Required conditions:

you need to know the SMTP gateway parameters Email, with which you need to send email, containing the OTP password;

need a custom script for sending emails;

We need a custom script in BAT (.bat) format that is set to a path in the ESA Management Console (see screenshot above) and that calls our custom script that sends the email;

For each user who has two-factor authentication (2FA) enabled and receives one-time passwords (OTP passwords) via email, you must enter an email address in the E-mail field on the General tab when viewing details for such users in the management interface Active Directory Users and Computers (Active Directory Users and Computers).

Sample Python script for sending email: We called this file sendmail.py:

import sys, smtplib

server = smtplib.SMTP(" smtpserver : port" )

server.starttls()

server.login("username","password")

server.sendmail(sys.argv , sys.argv, "Subject: OTP is "+sys.argv)

server.quit()

NOTE. In the sample Python script above, the parameters smtpserver:port , username and password should be replaced with the appropriate parameters SMTP.

Sample .bat script to call the sendmail.py script and pass it the necessary parameters: We called this file CustomMail.bat :

c:\Python\python.exe c:\work\sendmail.py %1 %2

NOTE. To work with this sample script, you need to install the Python library on your host machine (where the solution is installed ESA Core component ) and know the path to the python.exe file.

In the Sending OTP by field, we specify the path leading to our CustomMail.bat script, select the necessary parameters, for example (Email addresses) and , and then click Save.

Provisioning (mobile app delivery) can be configured in the same way using the required parameters (Phone) and (URL).

NOTE. : Compared to SMS delivery (or using a prepared mobile application), distribute passwords OTP using email is not as secure as the email can be read on any user's device. This method cannot confirm that the target recipient owns the registered phone (phone number).

Custom parameters and indicators allow you to send the necessary data to Google Analytics specifically for your tasks. For example, with their help you can upload such important indicators as or to Google Analytics. You can compare different segments with each other, for example, users who are logged in and not logged in, page authors, get values ​​when filling out fields in various forms, and the like, depending on the specifics of your site.

How do I add a custom dimension or metric?

  1. Open section "Administrator" and select the required resource.
  2. In column "Resource" click "Custom Definitions"> (or indicators).
  3. Click the button "+ Special parameter"(or indicator).
  4. Indicate its name.
  5. When adding a custom dimension or metric, select "Scope" from the following options: "Hit", "Session", "User", "Product"(more about scope).
  6. Also, when adding a custom indicator, select "Format Type" from the following options: "Integer", "Currency" or "Time".
  7. Check the box "Active" to start collecting data and adding a dimension or metric to your reports. If you do not want to activate the created setting, clear this check box.
  8. Click the button "Create".

Methods for sending to GA

Sending data via tracking code

// Send a custom parameter when viewing a page ga("send", "pageview", ( "dimension1": "My parameter" )); // Send a custom metric along with an event ga("send", "event", "category", "action", ( "metric1": 123 ));

Sending data via GTM

If Google Analytics is implemented on the site via GTM (which is recommended), then during tag activation, you can transfer custom parameters or metrics. To do this, go to "Additional settings", specify the index and value.

Sending data via Measurement Protocol

A guide to using the Measurement Protocol is described in the article “”, in which the user’s Client ID is passed to the cd14 user parameter.

Restrictions

In each resource you can add 20 custom parameters and another 20 indicators.

You can't delete custom dimensions or metrics, but you can turn them off.

Case for bypassing restrictions of 20 parameters and indicators

There are tasks when you need to track the completion of a calculator or some form on a website with big amount fields. It is not an option to create a separate parameter for each field, as you may run into a limit.

The way out of this situation is to create two parameters: the first for the names of the form fields, and the second for the values ​​​​entered in the fields.

Accordingly, we transfer the values ​​of the form fields to the “Calculator field - value”, and the field name itself to the “Calculator field - name”. And when, for example, we need to display all the values ​​of the “City” field, we simply set the filter for the special indicator “Calculator field - name” equal to the field name.

In March 2013 Google company launched beta for public testing - version of its updated web analytics system called Universal Analytics. The changes affected a lot, some of the functionality and are currently in testing.

In this article I will talk about one of the innovations of Universal Analytics - custom parameters and indicators.

In Universal Analytics, there are a lot of standard parameters and indicators that initially exist in the system (visits, geography, number of orders and goods, cost of goods, etc.), but what to do if standard functionality not enough?

Google offers to create your own parameters and metrics that the user can use when creating reports.

First, I will give several examples of reports that use custom dimensions & metrics, and then I will describe in detail how this can be implemented in practice without using a special Measurement Protocol data transfer protocol. Measurement Protocol is currently in public beta - testing and deserves a separate article.

Product report (sales)

Using this report, you can determine which products bring the most profit to the company. Moreover, based not on the total income from the product, but on real profit, using additional indicators “Purchase Cost” and “Profit”. This will also allow you to calculate ROI more correctly and accurately.

Product report (views + sales)

Using this report, you can determine not only the profit from each ordered product, but also the ratio of the number of pages viewed for each product to the number of purchases. Thus, it is possible to identify goods for which there is a high demand, but at the same time the number of their orders does not correspond to its level.

Brand report

The report is similar to the previous one, but only by brand.

Report on users (clients)

Using this report, you can not only obtain data for each user, but also analyze what marketing channels and devices they use when interacting with the company’s website.

Report by category

We study the sales structure of the “Portable Equipment” category:

Using this report, you can find out sales not only by the main category, but also analyze in more detail the structure of the categories within it (with standard tracking, Google Analytics allows you to set only one category for a product).

Practical implementation

To analyze your own parameters and indicators in Google Universal Analytics you need to:

1. Create the appropriate parameters and indicators in the Universal Analytics interface.

2. Implement the necessary code on the site.

Creating your own dimensions and metrics in Google Universal Analytics

1. Go to the “Administrator” section:

2. Find the “Custom Definitions” block

3. In this block we are interested in two items: “Custom parameters” and “Custom indicators”.

Below we will look at the definitions and differences between parameters and indicators.

Options are descriptive attributes or characteristics of an object that can be assigned different values. For example, a geographic location might have Latitude, Longitude, and City parameters. The City parameter can be assigned the values ​​Moscow, Kyiv or Singapore.

Indicators- These are individual elements of parameters that can be measured and expressed as a sum or ratio. For example, the City parameter can be associated with the Population indicator, for which the number of all residents of a given city will be indicated.

4. In the case of the reports discussed above, we will indicate what will be parameters and what will be indicators.

Custom options:

  • Brand.
  • Main category.
  • Username.
  • Product Name.
  • User ID.

Custom indicators: - Purchase cost. - Profit.

5. Create a custom parameter

Name - name of the parameter.

Scope - the level at which this parameter will operate.

There are several levels:

Hit- the parameter value applies only to one hit for which the parameter was called (example: page view, event call).

Session- the parameter value applies to all hits (page views) of one user session (example: tracking logged in and anonymous users).

User- the parameter value applies to all hits (page views) in current and future sessions until the value is changed or when the user parameter becomes inactive (example: gender, whether the visitor made a purchase, etc.).

Active - if the checkbox is checked, data collection and processing will begin immediately after creating the parameter.

6. List of created parameters

7. Create a custom indicator

The following information must be filled in:

Name - name of the indicator.

Formatting type - determines how the custom parameter will be displayed in reports.

Minimum and maximum value - optional value, specifies a range of values ​​that will be taken into account and included in reports.

Active - if the checkbox is checked, data collection and processing will begin immediately after the indicator is created.

8. List of created indicators

Implementation of the necessary codes on the site

When you create custom dimensions and metrics, Universal Analytics generates special code, which must be implemented on the site to collect data.

This code must be called at the moment when you need to set the required value for each parameter and indicator.

1. On the product page we implement the following code:

Thus, we transfer to the web analytics system data on page views for each product, brand and section in which it is included.

2. On the page with information about the successful completion of an order, along with the e-commerce tracking code, we implement the following code:

3. When the user logs in Personal Area, call the following code:

With this code we associate the current visit with one of the users/clients.

In conclusion, it is worth noting that all the reports presented in the article are intended to illustrate the features of work and the capabilities of user parameters and indicators in Google system Universal Analytics.

Leave your options in the comments possible use of this tool.

Google AdWords. Gedds Brad's Comprehensive Guide

Custom Options

Custom Options

If you have multiple lists, you don't have to create a new one; It is permissible to use custom parameters (Fig. 10.16). With their help you can create simple rules, which will tell Google to add users from existing A and B lists to the new list, or to include visitors from List A but exclude those on List B.

Rice. 10.16. Example of custom parameters

I'll give you a quick rundown of the strategy, but first I'll explain why it's recommended to use custom parameters. I work directly with Google and conduct seminars on AdWords. When a user visits a seminar page, we place a cookie in their browser (listed as AdWordsSeminarVisits in their user preferences). When a user registers and purchases a ticket, we place another cookie on their browser called SeminarRegistrationComplete.

In our example, if a user visited the seminar page but did not convert, they are listed. If he went there and made a conversion, he is not included in the list. This allows us to selectively show ads to those who don't convert and avoid wasting money on those who have already purchased a ticket to our seminar. You can always see how many cookies are active in this moment, on the remarketing screen in the shared library (Figure 10.17).

Rice. 10.17. Remarketing and active lists cookies

From the book The Way of the Turtles. From amateurs to legendary traders by Kurtis Face

Parameters mixed up I suggest everyone who wants to start trading using any system to complete the following exercise. Take several system parameters and change their values ​​significantly, for example by 20 or 25 percent. Select a point located significantly

From the book Crisis Management author Babushkina Elena

23. Basic parameters for diagnosing bankruptcy Currently, for diagnosing bankruptcy of enterprises, it is used limited circle parameters.1. The current liquidity ratio reflects the total security of the enterprise with working capital and cash

From the book Real Estate. How to advertise it author Nazaikin Alexander

From the book 1C: Enterprise 8.0. Universal tutorial author Boyko Elvira Viktorovna

11.4. User settings In the 1C:Enterprise operating mode, the user can change the password. To do this, select “Service - User Settings”. To change your password, you must first enter the password and confirm it. Setting a new password will take effect

From the book Fundamentals of Enterprise Cybernetics by Forrester Jay

7. 7. Parameters (constants) Many numerical values ​​that describe the characteristics of the system are taken constant, according to at least for the duration of calculations during one playback of the model. Rice. 7–7. Parameters (constants). They are indicated by a line above or below the symbol

From the book Logistics of storage of goods: A practical guide author Volgin Vladislav Vasilievich

13.5.5. Parameters (constants) of the system Now that we have completed the formulation of the equations that describe the behavior of the system and the equations that determine the initial conditions, we need to determine numeric values system parameters (values ​​that are constant throughout

From the book Logistics author Savenkova Tatyana Ivanovna

Parameters and equipment of the storage area Selecting the parameters of the storage area Before renting or designing a warehouse, it is necessary to solve the following tasks: – determining the tasks of warehouse management in supply chain movement of goods of the enterprise; – preparation of technical

From the book Marketing Management by Dixon Peter R.

7. 10. Basic parameters of warehouse zones A warehouse in a logistics system works to transform material (freight flows), changing in intensity and nature of incoming and outgoing flows, therefore the main indicators of warehouse capacity will directly depend

From the book 1C: Enterprise, version 8.0. Salary, personnel management author Boyko Elvira Viktorovna

Symbolic, intangible dimensions of quality management Some market segments buy quality as a symbol - quality products say a lot about their owner. Just as most people take pride in a job well done, we too take pride in owning

From the book Business Plan 100%. Effective business strategy and tactics by Rhonda Abrams

Parameters of a service quality management system Services vary in quality according to parameters such as speed, competence, courtesy, thoughtfulness, and customization of products (for example, shampoo and conditioner in hair salons). Correspondence,

From the book Google AdWords. Comprehensive Guide by Geddes Brad

17.4. User settings In the “1C: Enterprise” operating mode, the user can change the password. To do this, select “Service” - “User Settings”. To change your password, you must first enter the password and confirm it. Setting a new password will take effect

From the book More Than You Know. An unusual look at the world of finance by Mauboussin Michael

7.1. Basic assumptions and macroeconomic parameters of the project The activity of the enterprise is designed for an indefinitely long period, however, for the analysis of the investment project, a calculation horizon of 48 months was established. Conditional start date of the project –

From the author's book

Advanced Options and Filters Click on the “Advanced Options and Filters” link to select the type of data you want to receive (Figure 3.3). Rice. 3.3. Additional options and filtersYou can first select the country and language that suits your

From the author's book

Address Parameters: Basics In an address, the question mark acts as a separator and indicates where the query string begins. This is the part of the address that contains parameters, also called variables. The & character (ampersand) is used to

From the author's book

Other Adaptation Dimensions Different types of fitness landscapes require not only different combinations of short and long jumps, but also different financial instruments and organizational structures. The traditional discounted cash flow method is well suited

From the author's book

Limited Options Over the past 130 years, the average P/E ratio has been slightly above 14, and the market has fluctuated consistently around this level over that period6. Isn't this sufficient proof that 14 is the mean?