Goals

The “Goals” tool is used to determine the actions performed by visitors on your site.

As goals may be site registration, adding goods to the shopping cart, view of a specific section on your site, view of the landing page (for example, with a travel plan) - any action that is important for you.

Goal achievements in the counter can be defined in three ways:

  1. Fixed conditions that are checked for each view on the site. If condition is passed, the goal achievement is stated. Within the same view several goals can be stated if the view satisfies several conditions at once.
  2. Sending an event from javascript code to the site when user views the site in his browser. To do this the developer of the site writes code that determines the fact of goal reaching and sends information about this to the server. For this type of event usage of pixels is also available.
  3. Sending an offline event is similiar to an event from javascript code. As an example of such events may be the actual purchase of the goods by the user after the delivery home or visiting a shop. This type of goals has limitations described below.

The statistics of the site for each goal store:

  • The amount of achievements,
  • Sum of arbitrary goal values,
  • Statistics on the list of visitors sources who have reached goal,
  • Statistics on the list of interests of these visitors.

The attribution model “Last significant transition” is applied to determine the source of the visitor. Wherein some sources take precedence over others: advertising campaigns (regardless of the system), user sources specified by substrings in the URL and referrer, and user parameters have the highest priority; lower priority for transitions from search engines and other sites, including user-configured.

Stated conditions

For example select those who viewed the catalog. To do this, create the goal “Page URL includes”.

Any part of the page address or link that you define can be used as a substring, including non-standard labels. For example, the substring “result=ok” is suitable for counting page views like //top.mail.ru/Rating/?result=ok

Separately select those who came from a certain site. To do this you need to create a target of the type “Referrer includes”

To separate users who viewed a certain number of pages on the site, the goal type “Page view depth” is used.

Also it is possible to allocate separate segment of those who has spent on a site time minimally necessary for acquaintance. To do this, create the goal with the type “Time spent on a site”.

Visitor’s page view depth and time spent are counted within a day. Metrics are reset at midnight.

To separate users who visited your site within a certain number of sessions, the goal type “Sessions count” is used.

To separate users who viewed a certain number of pages within session, the goal type “Session’s page view depth” is used.

To separate users who spent a certain amount of time on a site, the goal type “Session’s duration” is used.

Events from javascript

To select users who have performed any targeted actions on the page (downloading the file, adding goods to the basket, filling out the form, etc.), receiving event from javascript sent by your site is used. Let’s consider an example: we want to highlight users who registered on the site.

To send an event with the name NAME from javascript place the latest counter code (received after May 20, 2013) at the beginning of your page and at the time of event execute the following javascript code:

_tmr.push({ id: 'your counter ID', type: 'reachGoal', goal: 'registered' });

The name of the event must consist of Latin letters or numbers. For our example with registration, we called the event registered

For an event from javascript you can get ready-made javascript code or pixel code by clicking on the “Get code” button or icon.

Depending on where the code will be used it should be modified and inserted appropriately.

Examples:

Inserting into the click handler on the link:

<a href='URL' onclick='var _tmr = window._tmr || (window._tmr = []); _tmr.push({ id: "counter ID", type: "reachGoal", goal: "registered" }); return true;'>link</a>

Inserting into the button handler:

<input type='button' onclick='var _tmr = window._tmr || (window._tmr = []); _tmr.push({ id: "counter ID", type: "reachGoal", goal: "registered" }); return true;' value="Buy">

Inserting into form:

<form onsubmit='var _tmr = window._tmr || (window._tmr = []); _tmr.push({ id: "counter ID", type: "reachGoal", goal: "registered" }); return true;'>...

Using with jQuery (for a link):

jQuery('#button').on('click', function(){ var _tmr = window._tmr || (window._tmr = []); _tmr.push({ id: "counter ID", type: "reachGoal", goal: "registered" }); return true; });

Using with jQuery (for a form):

jQuery('#form').on('submit', function(){ var _tmr = window._tmr || (window._tmr = []); _tmr.push({ id: "counter ID", type: "reachGoal", goal: "registered" }); return true; });

Instead of counter ID, you must enter the numeric identifier of your counter.

Value

Each goal can have a Value - a fixed number attached to a specific goal. When reaching a goal with a value, the value will be summed over all the achievements of the goal.

To send a target with the name NAME and a value VALUE from javascript, place the actual counter code (received after May 20, 2013) at the beginning of your page, and when you reach the goal, run the following javascript code:

var _tmr = window._tmr || (window._tmr = []);
_tmr.push({ id: "counter ID", type: "reachGoal", goal: "NAME", value: VALUE });

Sending offline events

Sending an offline event is similiar to an event from javascript code. As an example of such events may be the actual purchase of the goods by the user after the delivery home or visiting a shop. This type of goals has limitations described below.

To track these goals and compare them with visitors and their sources on the site you need to send the site user ID in userid parameter both when visiting the site and when sending an offline goal.

When visiting the site in the next line of source code

_tmr.push({id: "counter ID", type: "pageView", start: (new Date()).getTime()});

Add the userid parameter (separated by comma).

_tmr.push({id: "counter ID", type: "pageView", start: (new Date()).getTime(), userid: "USERID" });

And if you send the offline target to the pixel code

https://top-fwz1.mail.ru/tracker?id=ID;e=RG%3A/registered

Add the userid parameter (separated by comma)

https://top-fwz1.mail.ru/tracker?id=ID;e=RG%3A/registered;userid=USERID

The userid must be unique (different for different users), and the userid of the user in the online site visit must match the userid for the offline goal of the same user.