еще доразметка событий попыток оплаты на гпт4.1
This commit is contained in:
parent
3c925708ab
commit
8c02d1babb
1578
1inch-network.csv
Normal file
1578
1inch-network.csv
Normal file
File diff suppressed because it is too large
Load Diff
@ -2,13 +2,13 @@ import React, { useState, useEffect } from 'react';
|
||||
import { Link, useNavigate } from 'react-router-dom';
|
||||
import { getUserInfo, isTelegramWebAppAvailable, getCurrentUserId } from '../../constants/user';
|
||||
import { images } from '../../assets';
|
||||
import customAnalyticsService from '../../services/customAnalyticsService';
|
||||
import apiService from '../../services/api';
|
||||
import TokenPacksModal from '../tokens/TokenPacksModal';
|
||||
import { paymentService } from '../../services/paymentService';
|
||||
import { tokenPacks } from '../../constants/tokenPacks';
|
||||
import NotificationModal from '../shared/NotificationModal';
|
||||
import { useBalance } from '../../contexts/BalanceContext';
|
||||
import customAnalyticsService from '../../services/customAnalyticsService';
|
||||
import { getTranslation } from '../../constants/translations';
|
||||
import styles from './Header.module.css';
|
||||
|
||||
@ -79,6 +79,12 @@ const Header: React.FC = () => {
|
||||
event_category: 'ui_interaction',
|
||||
event_name: 'balance_button_click'
|
||||
});
|
||||
// Аналитика: открытие модального окна оплаты
|
||||
customAnalyticsService.trackEvent({
|
||||
telegram_id: getCurrentUserId(),
|
||||
event_category: 'payment',
|
||||
event_name: 'purchase_modal_open'
|
||||
});
|
||||
setShowTokensModal(true);
|
||||
}}
|
||||
title={getTranslation('add_balance_title')}
|
||||
@ -103,6 +109,13 @@ const Header: React.FC = () => {
|
||||
const pack = tokenPacks.find(p => p.id === packId);
|
||||
if (!pack) return;
|
||||
|
||||
// Аналитика: попытка оплаты
|
||||
customAnalyticsService.trackEvent({
|
||||
telegram_id: getCurrentUserId(),
|
||||
event_category: 'payment',
|
||||
event_name: 'purchase_attempt'
|
||||
});
|
||||
|
||||
setShowTokensModal(false);
|
||||
setLastPurchasedPack(pack);
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ import { tokenPacks } from '../constants/tokenPacks';
|
||||
import { paymentService } from '../services/paymentService';
|
||||
import apiService from '../services/api';
|
||||
import { getCurrentUserId } from '../constants/user';
|
||||
import customAnalyticsService from '../services/customAnalyticsService';
|
||||
import NotificationModal from '../components/shared/NotificationModal';
|
||||
import { getTranslation } from '../constants/translations';
|
||||
|
||||
@ -27,6 +28,12 @@ const CreateSticker: React.FC = () => {
|
||||
const userTokens = await apiService.getBalance(getCurrentUserId());
|
||||
if (userTokens < TOKENS_PER_GENERATION) {
|
||||
setMissingTokens(TOKENS_PER_GENERATION - userTokens);
|
||||
// Аналитика: открытие модального окна оплаты
|
||||
customAnalyticsService.trackEvent({
|
||||
telegram_id: getCurrentUserId(),
|
||||
event_category: 'payment',
|
||||
event_name: 'purchase_modal_open'
|
||||
});
|
||||
setShowTokensModal(true);
|
||||
return false;
|
||||
}
|
||||
@ -85,6 +92,13 @@ const CreateSticker: React.FC = () => {
|
||||
const pack = tokenPacks.find(p => p.id === packId);
|
||||
if (!pack) return;
|
||||
|
||||
// Аналитика: попытка оплаты
|
||||
customAnalyticsService.trackEvent({
|
||||
telegram_id: getCurrentUserId(),
|
||||
event_category: 'payment',
|
||||
event_name: 'purchase_attempt'
|
||||
});
|
||||
|
||||
setShowTokensModal(false);
|
||||
setLastPurchasedPack(pack);
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ import styles from './Profile.module.css';
|
||||
import { stickerService } from '../services/stickerService';
|
||||
import apiService from '../services/api';
|
||||
import { getCurrentUserId } from '../constants/user';
|
||||
import customAnalyticsService from '../services/customAnalyticsService';
|
||||
import TokenPacksList from '../components/tokens/TokenPacksList';
|
||||
import { tokenPacks, TokenPack } from '../constants/tokenPacks';
|
||||
import { paymentService } from '../services/paymentService';
|
||||
@ -47,6 +48,13 @@ const Profile: React.FC = () => {
|
||||
const pack = tokenPacks.find(p => p.id === packId);
|
||||
if (!pack) return;
|
||||
|
||||
// Аналитика: попытка оплаты
|
||||
customAnalyticsService.trackEvent({
|
||||
telegram_id: getCurrentUserId(),
|
||||
event_category: 'payment',
|
||||
event_name: 'purchase_attempt'
|
||||
});
|
||||
|
||||
setLastPurchasedPack(pack);
|
||||
|
||||
paymentService.showBuyTokensPopup(pack, async (userData) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user