# Global Money enhanced ecommerce
Нужно реализовать:
1) переходы на страницу на уникальный сервис с названием, например ""оплата Киевстар""). ОПИСАЛ В ТЗ КАК Я ВИЖУ РЕАЛИЗАЦИЮ
2) Добавление товаров в корзину - попробовать настроить чтобы понимать платежный профиль посетителя к примеру чаще всего люди оплачивают в рамках одной сессии то и то...
3) Оформление покупок - Этапы - Настройка последовательности оформления покупки
4) Покупки - Название товара/услуги + Событие успешной транзакции с доходом (с учетом комиссий) тоесть при оплате товара на 100 грн если наша комиссия 10 грн показываем доход 10 грн ЕСЛИ комиссия поставщика 5 грн показываем доход 5 грн
ОПИСАЛ В ТЗ КАК Я ВИЖУ РЕАЛИЗАЦИЮ c учетом а) Попытка - по сути просто нажатие на кнопку оплатить и Б) успешная оплата
5) Передача специальных параметров товара/показателей - если можно сделать чтобы было понятно как он оплачивал тот или иной сервис (метод) будет супер - ПРЕДЛАГАЮ ПИСАТЬ ЭТО В 'variant': '' _____
6) Валюта - грн
## Показ сведений о товаре - переход на страницу конкретной услуги
```
<script>
// Measure a view of product details. This example assumes the detail view occurs on pageload,
// and also tracks a standard pageview of the details page.
dataLayer.push({
'ecommerce': {
'detail': {
'actionField': {'list': 'Apparel Gallery'}, // 'detail' actions have an optional list property.
'products': [{
'name': 'НАЗВАНИЕ УСЛУГИ', // Name or ID is required.
'id': 'ИД УСЛУГИ',
'price': '15.25', <<<< НЕ ДОБАВЛЯТЬ
'brand': 'Google', <<<< НЕ ДОБАВЛЯТЬ
'category': 'ОПЛАТА КОММУНАЛЬНЫХ',
'variant': '' <<<< НЕ ДОБАВЛЯТЬ
}]
}
}
});
</script>
```
## Оформление покупки - введение платежных данных, нажатие кнопки “оплатить”
```
<script>
/**
* A function to handle a click on a checkout button. This function uses the eventCallback
* data layer variable to handle navigation after the ecommerce data has been sent to Google Analytics.
*/
function onCheckout() {
dataLayer.push({
'event': 'checkout',
'ecommerce': {
'checkout': {
'actionField': {'step': 1, 'option': 'C2W ИЛИ C2C'},
'products': [{
'name': 'НАЗВАНИЕ УСЛУГИ',
'id': '12345',
'price': 'НАШ ДОХОД',
'brand': 'Google', <<<< НЕ ДОБАВЛЯТЬ
'category': 'ОПЛАТА КОММУНАЛЬНЫХ',
'variant': 'C2W ИЛИ C2C',
'quantity': 1
}]
}
},
'eventCallback': function() {
document.location = 'checkout.html';
}
});
}
</script>
```
## Покупки - успешная оплата.
```
<script>
// Send transaction data with a pageview if available
// when the page loads. Otherwise, use an event when the transaction
// data becomes available.
dataLayer.push({
'ecommerce': {
'purchase': {
'actionField': {
'id': 'T12345', // Transaction ID. Required for purchases and refunds.
'affiliation': 'Online Store', <<<< НЕ ДОБАВЛЯТЬ
'revenue': 'НАША КОМИССИЯ ИСКЛ КОМ СЕРВИСА', // Total transaction value (incl. tax and shipping)
'tax':'', <<<< НЕ ДОБАВЛЯТЬ
'shipping': '5.99', <<<< НЕ ДОБАВЛЯТЬ
'coupon': 'SUMMER_SALE' <<<< НЕ ДОБАВЛЯТЬ
},
'products': [{ // List of productFieldObjects.
'name': 'НАЗВАНИЕ УСЛУГИ', // Name or ID is required.
'id': '12345',
'price': 'НАША КОМИССИЯ ИСКЛ КОМ СЕРВИСА',
'brand': 'Google', <<<< НЕ ДОБАВЛЯТЬ
'category': 'ОПЛАТА КОММУНАЛЬНЫХ',
'variant': 'C2W или C2C',
'quantity': 1, <<<< НЕ ДОБАВЛЯТЬ
'coupon': '' <<<< НЕ ДОБАВЛЯТЬ // Optional fields may be omitted or set to empty string.
}]
}
}
});
</script>
```