Global 2026-07-28
This commit is contained in:
parent
1a99baf15c
commit
7d6d4def15
@ -49,18 +49,12 @@ $area_served_raw = get_option('branch_area_served', 'Щёлково, Фрязи
|
||||
$front_faq = carbon_get_post_meta($post_id, 'front_faq');
|
||||
$faq_has = ! empty($front_faq) && is_array($front_faq);
|
||||
|
||||
// A/B тест: CTA в hero
|
||||
$ab_test_variant = $_COOKIE['ab_hero_cta'] ?? '';
|
||||
if (! in_array($ab_test_variant, array( 'A', 'B' ), true)) {
|
||||
$ab_test_variant = ( rand(0, 1) === 0 ) ? 'A' : 'B';
|
||||
setcookie('ab_hero_cta', $ab_test_variant, time() + 14 * DAY_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), true);
|
||||
}
|
||||
?>
|
||||
<main class="main-page">
|
||||
|
||||
<?php get_template_part('template-parts/svg-sprite'); ?>
|
||||
|
||||
<?php get_template_part('template-parts/hero-front', null, array( 'ab_variant' => $ab_test_variant )); ?>
|
||||
<?php get_template_part('template-parts/hero-front'); ?>
|
||||
|
||||
<?php get_template_part('template-parts/answer-block'); ?>
|
||||
|
||||
@ -342,22 +336,6 @@ if (! in_array($ab_test_variant, array( 'A', 'B' ), true)) {
|
||||
<?php get_template_part('template-parts/sticky-cta'); ?>
|
||||
|
||||
<script>
|
||||
// A/B test tracking — hero CTA variant
|
||||
document.addEventListener('click', function(e) {
|
||||
var btn = e.target.closest('[data-track^="hero_cta_"]');
|
||||
if (btn) {
|
||||
var v = btn.dataset.track === 'hero_cta_B' ? 'B' : 'A';
|
||||
if (typeof gtag === 'function') {
|
||||
gtag('event', 'ab_hero_cta', {
|
||||
'event_category': 'ab_test',
|
||||
'event_label': v,
|
||||
'variant': v,
|
||||
'non_interaction': false
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Scroll depth tracking (GA4)
|
||||
(function() {
|
||||
var depths = [25, 50, 75, 100], tracked = {};
|
||||
|
||||
@ -12,9 +12,6 @@ if (! defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// ─── A/B ТЕСТ ───
|
||||
$ab_variant = $args['ab_variant'] ?? 'A';
|
||||
|
||||
// ─── ДАННЫЕ ФИЛИАЛА ───
|
||||
$branch_phone = get_option('branch_phone') ?: crb_get_theme_option('site_phone');
|
||||
$branch_city = get_option('branch_city') ?: crb_get_theme_option('site_city', 'Щёлково');
|
||||
@ -165,8 +162,8 @@ if (! empty($extra_msgs) && is_array($extra_msgs)) {
|
||||
<div class="ds-hero__seats">Осталось <strong><?php echo esc_html($remaining_seats); ?></strong> мест в 1 класс — успейте записаться!</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<button class="ds-hero__cta-btn btn-write open-bitrix-form" data-track="hero_cta_<?php echo esc_attr($ab_variant); ?>">
|
||||
<?php echo ( $ab_variant === 'B' ) ? 'Записаться на экскурсию бесплатно' : 'Получить консультацию'; ?>
|
||||
<button class="ds-hero__cta-btn btn-write open-bitrix-form">
|
||||
Получить консультацию
|
||||
</button>
|
||||
<noscript>
|
||||
<div class="ds-hero__cta-fallback">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user