# Nestar - Measurement plan | Developer Instructions | Web | Google
This measurement plan contains an overview of all data(points) we advise to collect on your platform. These are supplemented with code snippet instructions aimed at developers who play an important role in the measurement setup. As not all data is available on the page initially, we ask developers to prepare this and provide the necessary data when certain interaction events take place. Our goal is to deploy an error-proof setup which is not prone to changes in the DOM of the website. Therefore we strive to collect as much data as possible made available through back- and frontend data streams.
Every part of the measurement plan is structured by an ‘if’, ‘then’, ‘whereby’ structure that explains the exact moment data needs to be made available.
## [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Table-of-Contents "Table-of-Contents")Table of Contents
<span class="toc"></span>
## [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Basics "Basics")Basics
### [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Data-Layer-per-page "Data-Layer-per-page")Data Layer per page
On each page it is required to implement a generic dataLayer variable which needs to be filled with relevant information form the data layer push below. If a certain value is unknown, the value can be an empty string.
The following data layer has to be filled at every page:
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'init',
'user': user_object,
'page': page_object
})
</script>
* * *
### [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#User-object-per-page "User-object-per-page")User object per page
<span style="font-weight: 700;">If</span> a page loads
<span style="font-weight: 700;">Then</span> on each page the data layer has to contain a user object, which holds the data of the user.
{
'userId': 'user_id_hashed_sha256', // SHA-256 hashed unique user id from backend
'loggedIn': 'logged_in_status', // String being '1' or '0'
'visitor_type': 'visitor_type', // External or internal (employee)
'Email': 'Email', // Email provided by the user
'Phone': 'Phone', // Phone provided by the user
'FirstName': 'FirstName', // FirstName provided by the user
'LastName': 'LastName' // LastName provided by the user
}
> <span style="font-weight: 700;">Note:</span>
> UserId and email can only be populated if the user is logged in to the website. If the user is not logged in, values should be an empty string.
* * *
### [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Page-object-per-page "Page-object-per-page")Page object per page
<span style="font-weight: 700;">If</span> a page loads
<span style="font-weight: 700;">Then</span> on each page the data layer has to contain a page object, which holds the data of the page.
{
'page_type': 'page_type' // Site category such as home, listing, property page, blog etc.
}
* * *
## [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Other-events "Other-events")Main events
### [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Account---Successful-login "Account---Successful-login")Property listing
<span style="font-weight: 700;">If</span> a user visits listing page:
<span style="font-weight: 700;">Then</span> the following dataLayer has to be filled:
```
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'view_item_list',
'item_list_id': 'item_list_id', // The ID of the list in which the item was presented to the user.
'item_list_name': 'item_list_name', // The name of the list in which the item was presented to the user.
'item_type': 'item_type', // Category of the apartment. If the type is "Viviendas de alquiler", then "Alquiler". If the type is "Viviendas de venta", then "Venta".
'items': [
{
'item_id': 'item_id', // The ID of the item. *One of item_id or item_name is required.
'item_name': 'item_name', // The name of the item. *One of item_id or item_name is required.
'currency': 'currency', // The currency, in 3-letter ISO 4217 format.
'discount': 'discount', // The monetary discount value associated with the item.
'item_list_id': 'item_list_id', // The ID of the list in which the item was presented to the user.
'item_list_name': 'item_list_name', // The name of the list in which the item was presented to the user.
'price': 'price' // The monetary price of the item, in units of the specified currency parameter.
}
]
});
</script>
```
<span style="font-weight: 700;">Screenshot</span>

* * *
### [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Account---Account-registration "Account---Account-registration")Newsletter signup
<span style="font-weight: 700;">If</span> a user <span style="font-weight: 700;">successfully</span> subscribes to the newsletter
<span style="font-weight: 700;">Then</span> the following dataLayer has to be filled:
```
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'newsletter_signup',
'form_id':'form_id',
'form_name':'form_name',
'form_destination':'form_destination', // The place where the form is located on the site
'form_submit_text':'form_submit_text' // Text on the submit button
});
</script>
```
<span style="font-weight: 700;">Screenshot</span>

* * *
### [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Newsletter---Newsletter-sign-up "Newsletter---Newsletter-sign-up")Сontact form
<span style="font-weight: 700;">If</span> a user <span style="font-weight: 700;">successfully</span> submits the form
<span style="font-weight: 700;">Then</span> the following dataLayer has to be filled:
```
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'form_submit',
'form_id':'form_id',
'form_name':'form_name',
'form_destination':'form_destination', // The place where the form is located on the site
'form_submit_text':'form_submit_text', // Text on the submit button
'Email': 'Email_hashed_sha256', // SHA-256 hashed unique Email provided by the user
'Phone': 'Phone_hashed_sha256', // SHA-256 hashed unique Phone provided by the user
'FirstName': 'FirstName_hashed_sha256', // SHA-256 hashed unique FirstName provided by the user
'LastName': 'LastName_hashed_sha256' // SHA-256 hashed unique LastName provided by the user
'item_type': 'item_type', // Category of the apartment. If the type is "Viviendas de alquiler", then "Alquiler". If the type is "Viviendas de venta", then "Venta".
});
</script>
```
<span style="font-weight: 700;">Screenshot</span>

---
# Motivo del contacto New
If a user successfully submits the form
Then the following dataLayer has to be filled:
```
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'form_submit',
'form_id':'form_id',
'form_name':'form_name',
'form_destination':'form_destination', // The place where the form is located on the site
'form_submit_text':'form_submit_text', // Text on the submit button
'Email': 'Email_hashed_sha256', // SHA-256 hashed unique Email provided by the user
'Phone': 'Phone_hashed_sha256', // SHA-256 hashed unique Phone provided by the user
'FirstName': 'FirstName_hashed_sha256', // SHA-256 hashed unique FirstName provided by the user
'LastName': 'LastName_hashed_sha256', // SHA-256 hashed unique LastName provided by the user
'start_date': 'start_date', // start_date provided by the user
'end_date': 'end_date', // end_date provided by the user
'Personas': 'Personas', // Personas provided by the user
'Check_box': 'Check_box_hashed_sha256', // SHA-256 hashed unique Checkbox provided by the user
'item_type': 'item_type', // Category of the apartment. If the type is "Viviendas de alquiler", then "Alquiler". If the type is "Viviendas de venta", then "Venta".
});
</script>
```
Screenshot

* * *
## [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Other-events "Other-events")Other events
### [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Newsletter---Newsletter-subscription "Newsletter---Newsletter-subscription")Property page visit
<span style="font-weight: 700;">If</span> a user visits property page
<span style="font-weight: 700;">Then</span> the following dataLayer has to be filled:
```
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'view_item',
'currency': 'currency', // The currency, in 3-letter ISO 4217 format.
'value': 'value', // The monetary value of the event.
'item_type': 'item_type', // Category of the apartment. If the type is "Viviendas de alquiler", then "Alquiler". If the type is "Viviendas de venta", then "Venta".
'items': [
{
'item_id': 'item_id', // The ID of the item. *One of item_id or item_name is required.
'item_name': 'item_name', // The name of the item. *One of item_id or item_name is required.
'currency': 'currency', // The currency, in 3-letter ISO 4217 format.
'discount': 'discount', // The monetary discount value associated with the item.
'item_list_id': 'item_list_id', // The ID of the list in which the item was presented to the user.
'item_list_name': 'item_list_name', // The name of the list in which the item was presented to the user.
'price': 'price', // The monetary price of the item, in units of the specified currency parameter.
'city': 'city', // The city in which the property is located
'city_area': 'city_area', // Area of the city in which the property is located
'street': 'street', // The street where the property is located
'address': 'address', // The address where the property is located
'property_type': 'property_type', // Property type such as penthouse, duplex, studio, loft etc.
'property_condition': 'property_condition', // Property condition such as new construction, refurbished, subsidized housing
'area': 'area', // Apartment size
'bedrooms_quantity': 'bedrooms_quantity', // Number of bedrooms
'bathrooms_quantity': 'bathrooms_quantity', // Number of bathrooms
'elevator': 'elevator', // Availability of an elevator
'сommunal_expenses': 'сommunal_expenses', // Are communal costs included
'parking': 'parking', // Availability of parking
'furnishings': 'furnishings', // Furnishings
'floor': 'floor', // Floor
'heating': 'heating', // Type of heating
'start_date': 'start_date', // start_date provided by the user
'end_date': 'end_date', // end_date provided by the user
'Personas': 'Personas', // Personas provided by the user
'Check_box': 'Check_box_hashed_sha256', // SHA-256 hashed unique Checkbox provided by the user
}
]
});
</script>
```
> **In addition to the standard parameters for the view_item event, we suggest passing custom parameters:**
| Name | Description |
| -------- | -------- |
city | The city in which the property is located
city_area | Area of the city in which the property is located
street | The street where the property is located
address | The address where the property is located
price | The monetary price of the property
property_type | Property type such as penthouse, duplex, studio, loft etc.
property_condition | Property condition such as new construction, refurbished
area | Apartment size
bedrooms_quantity | Number of bedrooms
bathrooms_quantity | Number of bathrooms
elevator | Availability of an elevator
сommunal_expenses | Are communal costs included
parking | Availability of parking
furnishings | Furnishings
floor | Floor
heating | Type of heating
pets | Are pets allowed
additional_facilities | Additional facilities such as Terrace etc.
start_date | Arrival date
end_date | Date of departure
personas | Number of settlers
check_box | Marked at the bottom of the form
<span style="font-weight: 700;">Screenshot</span>

* * *
### [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Newsletter---Newsletter-subscription "Newsletter---Newsletter-subscription")Share apartment
<span style="font-weight: 700;">If</span> a user shares an apartment
<span style="font-weight: 700;">Then</span> the following dataLayer has to be filled:
```
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'share',
'method': 'method', // The method in which the content is shared. Example value: Twitter
'content_type': 'content_type', // The type of shared content. Example value: image
'item_id': 'item_id' // The ID of the shared content.
'item_type': 'item_type', // Category of the apartment. If the type is "Viviendas de alquiler", then "Alquiler". If the type is "Viviendas de venta", then "Venta"
});
</script>
```
<span style="font-weight: 700;">Screenshot</span>


* * *
### [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Newsletter---Newsletter-subscription "Newsletter---Newsletter-subscription")Explore 360 view
<span style="font-weight: 700;">If</span> a user uses the 360 view
<span style="font-weight: 700;">Then</span> the following dataLayer has to be filled:
```
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'explore_360_view',
'item_id': 'item_id', // The ID of the item.
'item_name': 'item_name' // The name of the item.
'item_type': 'item_type', // Category of the apartment. If the type is "Viviendas de alquiler", then "Alquiler". If the type is "Viviendas de venta", then "Venta"
});
</script>
```
<span style="font-weight: 700;">Screenshot</span>

* * *
### [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Newsletter---Newsletter-subscription "Newsletter---Newsletter-subscription")See all photos
<span style="font-weight: 700;">If</span> a user sees photos of an apartment
<span style="font-weight: 700;">Then</span> the following dataLayer has to be filled:
```
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'see_all_photos',
'item_id': 'item_id', // The ID of the item.
'item_name': 'item_name' // The name of the item.
'item_type': 'item_type', // Category of the apartment. If the type is "Viviendas de alquiler", then "Alquiler". If the type is "Viviendas de venta", then "Venta"
});
</script>
```
<span style="font-weight: 700;">Screenshot</span>

* * *
### [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Menu---Main-menu-use "Menu---Main-menu-use")Parameter filter
<span style="font-weight: 700;">If</span> a user uses filter options
<span style="font-weight: 700;">Then</span> the following dataLayer has to be filled:
```
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'parameter_filter',
'filter_action': 'filter_action', // filter_action has one of the following values: apply_filter, clear_all_filter
'filter_price_min': 'filter_price_min',
'filter_price_max': 'filter_price_max',
'filter_size_min': 'filter_size_min',
'filter_size_max': 'filter_size_min',
'filter_property_type': 'filter_property_type', // Housing type such as penthouse, duplex, studio, loft etc.
'filter_property_condition': 'filter_property_condition', // Property condition such as new construction, refurbished, subsidized housing
'filter_city': 'filter_city', // The city in which the property is located
'filter_city_area': 'filter_city_area', // Area of the city in which the property is located
'filter_results_count': 'filter_results_count' // Number of results after applying filters
});
</script>
```
<span style="font-weight: 700;">Screenshots</span>


* * *
### [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Menu---Main-menu-use "Menu---Main-menu-use")Sort options
<span style="font-weight: 700;">If</span> a user uses sort options
<span style="font-weight: 700;">Then</span> the following dataLayer has to be filled:
```
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'sort_options',
'sort_option': 'sort_option' // Parameter by which sorting is performed, such as by price, by area, by relevance
});
</script>
```
<span style="font-weight: 700;">Screenshots</span>

* * *
### [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Menu---Footer-menu-use "Menu---Footer-menu-use")Site search
<span style="font-weight: 700;">If</span> a user searches for content on the site
<span style="font-weight: 700;">Then</span> the following dataLayer has to be filled:
```
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'search',
'search_term': 'search_term', // The term that was searched for.
'search_results_count': 'search_results_count', // Number of search results
'search_results': [
{
'item_id': 'item_id', // The ID of the item.
'item_name': 'item_name', // The name of the item.
}
]
});
</script>
```
<span style="font-weight: 700;">Screenshots</span>


* * *
### [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Menu---Footer-menu-use "Menu---Footer-menu-use")Search unavailable
<span style="font-weight: 700;">If</span> a user searches for content on the site and it is not available
<span style="font-weight: 700;">Then</span> the following dataLayer has to be filled:
```
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'search_unavailable',
'search_term': 'search_term' // The term that was searched for.
});
</script>
```
<span style="font-weight: 700;">Screenshots</span>

* * *
### [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Menu---PDP-menu-use "Menu---PDP-menu-use")Map interaction
<span style="font-weight: 700;">If</span> a user clicks expand the map
**or**
<span style="font-weight: 700;">If</span> a user clicks close the map
**or**
<span style="font-weight: 700;">If</span> a user moves the map with the cursor to view property
**or**
<span style="font-weight: 700;">If</span> a user selects a property on the map
<span style="font-weight: 700;">Then</span> the following dataLayer has to be filled:
```
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'map_interaction',
'map_action': 'map_action', // Actions that were performed with the map, such as open, close, move, select a property
'item_id': 'item_id', // If a property is selected on the map
'item_name': 'item_name' // If a property is selected on the map
'item_type': 'item_type', // Category of the apartment. If the type is "Viviendas de alquiler", then "Alquiler". If the type is "Viviendas de venta", then "Venta"
});
</script>
```
<span style="font-weight: 700;">Screenshot</span>



* * *
## [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Other-events "Other-events")User account
### [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Filter---Apply-filter "Filter---Apply-filter")Sign up
<span style="font-weight: 700;">If</span> а user **successfully** signed up
<span style="font-weight: 700;">Then</span> the following dataLayer has to be filled:
```
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'sign_up',
'method': 'method', // The method used for sign up. Example value: Google
'userId': 'user_id_hashed_sha256' // SHA-256 hashed unique user id from backend
});
</script>
```
<span style="font-weight: 700;">Screenshot</span>
\---
* * *
### [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Filter---Apply-filter "Filter---Apply-filter")Login
<span style="font-weight: 700;">If</span> а user **successfully** logged in
<span style="font-weight: 700;">Then</span> the following dataLayer has to be filled:
```
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'login',
'method': 'method', // The method used to login. Example value: Google
'userId': 'user_id_hashed_sha256' // SHA-256 hashed unique user id from backend
});
</script>
```
<span style="font-weight: 700;">Screenshot</span>
\---
* * *
## [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Other-events "Other-events")Discounts
<span style="font-weight: 700;">If</span> а user clicks on the discount
<span style="font-weight: 700;">Then</span> the following dataLayer has to be filled:
```
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'discount_click',
'discount_name': 'discount_name',
'discount_id': 'discount_id',
'discount_type': 'discount_type', // Discount type such as monetary or percentage discount
'discount_amount': 'discount_amount' // Amount of discount
});
</script>
```
<span style="font-weight: 700;">Screenshot</span>

* * *
## [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Other-events "Other-events")Page view events
We will be able to set these events if needed through GTM without sending the event through the data layer.
The trigger will be a **pageview** with a condition such as **page_type = blog**
* Blog visit
* Blog article view
* Main page
* Services
* About us
* Contact
* User account visit
* My reservations visit
* My contracts visit
* My favorites visit
* * *
## [<span class="octicon octicon-link" style="color: rgb(0, 0, 0); vertical-align: middle; visibility: hidden;"></span>](#Contact-for-Questions "Contact-for-Questions")Contact for Questions
<div class="alert alert-info" style="font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; font-size: 16px; letter-spacing: 0.35px; margin-bottom: 0px !important;">
<span style="font-weight: 700;">For all the questions regarding the measurement plan please reach out to:</span>
Diana Dranovskaya - diana.dranovskaya@newage.agency
</div>