Google analytics specific metric. Custom definitions (custom dimensions and metrics). Why are special indicators needed?

The ability to use “custom dimensions and metrics” came with the new version of Google Analytics. If earlier, in the now classic version of Google Analytics, we were given the opportunity to manipulate 5 user variables, now in Universal Analytics we can use up to 20 custom parameters and indicators.

For ease of working with the material, I divided it into blocks:

  • 1. What are custom dimensions and metrics?
  • 2 .For what purposes can Universal Analytics custom dimensions and metrics be used?
  • 3 .Restrictions on the use of custom parameters and metrics.
  • 4 .Creation of custom parameters and indicators.
  • 5. Setting the values ​​of user parameters and indicators.
  • 6. Working with custom parameters and metrics in Google Analytics reports.

What are custom dimensions and metrics?

In simple terms, parameters describe the characteristics of some object, for example, it could be the title or URL of a page.

Custom metrics convey values, such as: the conditional value of a site page in points.

What can Universal Analytics custom dimensions and metrics be used for?

  1. you can use them to transmit information to Google Analytics that is not included in standard reports;
  2. Custom dimensions and metrics are used in Google Analytics features such as data enhancement and cost data import;
  3. they allow you to tag visitors and then analyze the behavior of different groups of users, for example, those who are registered on the site and those who have not completed this procedure.

This is by no means an exhaustive list of possible options for using parameters and indicators that you can create yourself.

Limitations on the use of custom dimensions and metrics.

In the classic version of Google Analytics, you can use 5 custom variables, in the Universal Analytics version - up to 20 custom parameters and indicators. If you are a Premium user, you can create up to 200 of your own parameters and metrics.

Note: 20 and 200 are the total number of parameters and indicators. That is, you can create 15 parameters and 5 indicators (20 in total), but not 20 parameters and 20 indicators (40 in total).

The limit is set for each resource.

Creation of custom parameters and indicators.

In order to create a custom parameter or indicator, you need to go to administrator mode, select the desired (from available) resource, and then find the “Custom Definitions” item in the menu:

Then select the desired value: parameter or indicator (depending on what you are going to create). After selecting, a page will open that displays all the parameters or indicators previously created for the resource:

Available Universal Analytics Dimensions and Metrics

To create a new entry, click on the red button at the top of the table:

A form will be displayed in which you need to fill out the “Name” field (it will be used in reports), and also indicate the scope of the parameter or indicator:


Creating a Google Analytic Dimension s

If you are not familiar with the scope of parameters and metrics, I recommend that you read the official documentation (in English).

If it is difficult for you to understand the principle of operation of hits, sessions and user level, then I will try to expand on this topic a little.

Google Analytics is all about hits. A single page view, an event on a website, a transaction, a social action, etc. – all this is called hits. For clarity, let's call this “your step.”

Session– this is a set of hits that are executed until the session is interrupted, i.e., until 30 minutes of user inactivity have passed (the default time). Until this moment, the session is considered active. For clarity, these are your steps (hits) from the first step (hit) to the final step (hit). After 30 minutes you have taken a step (hit): the second path has begun (a new, second session).

User level– these are all the hits and sessions of one user: these are all your steps (hits) and paths (sessions) for the time you can move.

About how they behave values, set for parameters and indicators at various levels, are quite informatively displayed in illustrations in the official documentation. I advise you to sort this out so that later questions do not arise: “Why are some values ​​“overwritten”?”

Setting the values ​​of user parameters and indicators.

Once you have created the dimensions and metrics you need, you need to start assigning values ​​to them. This can be done in different ways ways:

  1. via tracking code;
  2. using Google Tag Manager;
  3. using Measurement Protocol.

Let's look at each of the options listed.

After you create a new parameter or indicator in the “Control Panel”, you will be offered a code to place on the pages of the site or in the application:


Example code for setting a parameter value

This is the first way to set the value (via tracking code). It can also be implemented using two slightly different ways .

Option 1. Setting the value of a custom parameter or metric when sending data about a hit (page view, event, etc.). Example implementation:

// passing a value when sending page view data ga("send", "pageview", ( "dimension15": "My Custom Dimension" )); // passing a value when sending event data ga("send", "event", "category", "action", ( "metric18": 8000 ));

Option 2. Setting the value of a custom parameter or indicator using the method
set. Example implementation:

1 // setting the value
2 ga("set", "dimension5","custom data");

In the second option, the value is set for all hits that will be called after setting the value. For example, you set the desired value, and then data about the page view is sent to the pages, and then the action is recorded. In this case, the value of the parameter or metric will be transmitted for both the page view and the event.

If the first option is used, then the values ​​are transmitted only for the hit where they are listed.

A common mistake is to use the second option and set the value via set(after calling the send method). Remember: setting any value via set must be done before calling send.

Correct Use:

1 // setting the value
2
3
4 // send event data
5

Incorrect use:

1 // send event data
2 ga("send", "event", "category", "action");
3
4 // setting the value
5 ga("set", "dimension5", "custom data");

Next method– data transfer using Google Tag Manager. This method must be used if Google Analytics was implemented on the site using Google Tag Manager.

In order to indicate that when activating a tag, the values ​​of a custom parameter or indicator should be transferred, when setting up a tag, you need to click on the “Additional settings” block, and then find the lines “Special parameters” or “Special indicators” and click on the desired one. You will see something like this::


Creating Dimensions and Metrics in Google Tag Manager

An example of setting a parameter in Google Tag Manager

Where does the value for the Index field come from? It is assigned when you create a parameter or indicator in the dashboard:


Example of creation in Google Tag Manager

You can use a constant value as the parameter value, which is entered into the corresponding field. In addition, you can specify the value of any available macro:


Parameter value from macro

Once the settings have been made, the values ​​will be transmitted each time the tag is activated.

The third way to transfer values ​​is to use the Measurement Protocol or Google Analytics Data Transfer Protocol.

If you are not yet familiar with this opportunity, I recommend that you familiarize yourself with it in this material.

I will briefly discuss this possibility because... There shouldn’t be any difficulties when using it (if something doesn’t work out, return to the description and operating principle of the protocol itself).

To indicate that a query has dimensions and metrics, use additional parameters named cdN and/or cmN, Where N is the index assigned when creating the parameter or measure.

An example of a Measurement Protocol request sent using JQuery when a button with id=buttonId is clicked:

1 $("#buttonId").click(function())(
2 $.post(
3 "www.google-analytics.com/collect",
4 {
5 v: "1",
6 tid: "UA-xxxxx-1",
7 cid: "12xx916x95.13x6127xx4",
8
9 t: "event",
10 ec: "Event check",
11 ea: "Virtual",
12
13 cd1: "Parameter value",
14 cm2: 3, // indicator value
15 },
16 onAjaxSuccess
17 )
18 });

Pay attention to the line with values cd1 And cm1: They pass values ​​for parameter at index 1 and measure at index 2.

You should also be aware that there is a limit on the parameter value of 150 bytes (documentation).

After the necessary parameters and indicators have been created, values ​​are transferred for them: you can start working with the collected data.

Working with custom parameters and metrics in Google Analytics reports.

You have done a lot of work creating and configuring parameters and indicators, organizing the transfer of the necessary values, but it will be useless if no one can work with the received data. There are no problems with this in Google Analytics. Your information is available both in standard reports and in custom ones.

Working with standard reports.

Use in extended segments:

Use in custom reports:

Use in Google Analytics custom reports

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 that tell Google to add users from existing lists A and B to the new list, or to include visitors from list A, but exclude those from 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 currently active on the remarketing screen in the shared library (Figure 10.17).

Rice. 10.17. Remarketing lists and active 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, a limited range of parameters is used to diagnose bankruptcy of enterprises.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 assumed to be constant, at least for the duration of the 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. System parameters (constants) 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 the numerical values ​​of the 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 warehousing in the logistics chain for the movement of goods of the enterprise; – preparing 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?

4 User parameters

Review

Sometimes you may want to perform a check through an agent, which is not predefined in Zabbix. In this case, custom parameters will come to your aid.

You can write a command that will return the data you need and add this command as a user parameter to the agent configuration file ("UserParameter" configuration parameter).

The custom parameter has the following syntax:

UserParameter=<ключ>,<команда>

As you can see, the custom parameter also contains a key. The key will be required when setting up the data item. Enter a key of your choice that can be easily referenced (it must be unique within the host). Restart the agent.

UNIX operating systems use a command line interpreter /bin/sh. User parameters are subject to the waiting time for agent checks; if the timeout is exceeded, the process created using user parameters will be terminated.

See also:

Examples of simple user parameters

Simple command:

UserParameter=ping,echo 1

The agent will always return "1" for the item with the key "ping".

More complex example:

UserParameter=mysql.ping,mysqladmin -uroot ping|grep -c alive

The agent will return "1" if the MySQL server is available, "0" otherwise.

Flexible user options

Flexible user parameters allow parameters with a specified key. In this case, flexible user parameters can be the basis for creating multiple data items.

Flexible user parameters have the following syntax:

UserParameter=key[*],command

ParameterDescription
Key The unique key of the data item. [*] specifies that the key can accept parameters from parentheses. Parameters are specified when setting up a data item.
Team The command that is executed to obtain the value of the key.
For Flexible Custom Options only:
You can use position references $1...$9 to refer to the corresponding parameter in the data item key.
Zabbix parses the parameters enclosed in the data item key and replaces $1,...,$9 in the command accordingly.
$0 will be replaced by the original command (before expanding $0,...,$9) for execution.
References to positions are interpreted by the Zabbix agent regardless of whether they are enclosed in double (“”) or single (“”) quotes.
To use line item references without modification, specify a double dollar sign - for example, awk "(print $$2)". In this case, $$2 will actually become $2 when the command is executed.

References to positions starting with a $ sign are searched and replaced by the Zabbix agent only in the case of flexible user parameters. In the case of simple user parameters, such references are skipped and therefore escaping any $ signs is not required.

By default, some characters are not allowed in user settings. See the UnsafeUserParameters documentation for a complete list of such symbols.

Example 1

A very simple example:

UserParameter=ping[*],echo $1

We can create an unlimited number of data items to monitor anything by specifying ping[anything] in this format.

    ping - will always return '0'

    ping - will always return 'aaa'

Example 2

Let's add more meaning!

UserParameter=mysql.ping[*],mysqladmin -u$1 -p$2 ping | grep -c alive

This option can be used to monitor the availability of MySQL databases. We can pass the username and password as parameters:

Mysql.ping

Example 3

Command Result

The output of the command is standard output along with standard error output.

​A text data element (character,​ log, or text information types) will not become unsupported if an error is output on standard output.

Custom parameters that return text (character, log, text info types) can return space. If the result is incorrect, the data item will become unsupported.

Custom dimensions and metrics are used in much the same way as the default ones, except that you create them yourself. Custom dimensions and metrics can help you collect data that Google Analytics doesn't automatically track.

Custom dimensions and metrics can be created and modified at the level resource in your Google Analytics account, if you have permission to change them.

Creating a custom dimension or metric is a two-step process. First, create a custom dimension or metric for your property. Then change the tracking code. Follow the steps below in order.

Content

How to create custom parameters

  1. Open the Administrator section and go to the required resource.
  2. In column Resource click Custom Definitions > Custom Parameters.
  3. Click the button + Special parameter.
  4. Please indicate it Name.
    Choose a descriptive name so as not to confuse the new element with other parameters and indicators.
  5. Fill in the field Scope.
    The following options are available: Case, Session, User, Product." For more information about scope and using special parameters, read the developer guide.
  6. Check the box Active to start collecting data and adding the parameter to your reports. If you do not want to activate the created setting, clear this check box.
  7. Click the button Create.

How to create custom metrics

  1. Open the Administrator section and go to the required resource.
  2. In column Resource click Special definitions > Special indicators.
  3. Click the button + Special indicator.
  4. Specify Name.
    We recommend choosing a unique and informative name that will be convenient to work with.
  5. In the drop down menu Formatting type select the desired option: Integer, Currency or Time.
    The integer can be anything. The currency corresponds to the one specified in the presentation settings (US dollar, yen, etc.), and the amount is indicated as a decimal fraction. The time is indicated in seconds, but in reports it is displayed in the format hh:mm:ss.
  6. Check the box Active to start collecting data and adding the metric to your reports. Clear the check box if you want the metric you create to remain inactive.
  7. Click the button Create.

Changing the tracking code

After you create a custom dimension or metric for a resource you also need to change the tracking code. This should be done by a qualified developer. Instructions can be found in the appropriate developer guide.

In March 2013, Google 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 the standard functionality is 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 creating custom parameters and metrics, Universal Analytics generates special code that 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 into his personal account, 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 and capabilities of custom parameters and indicators in the Google Universal Analytics system.

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