A
A
Artyom2018-03-06 18:07:43
1C-Bitrix
Artyom, 2018-03-06 18:07:43

How to display a non-cached area in the bitrix site header?

Hello!
I'm trying to dynamically change the phone number in the site header (header.php) depending on the traffic source.
The site is based on CMS 1C-Bitrix, autocaching is working and the "composite site" mode is enabled.
The algorithm is as follows:
When a visitor goes to the site, information from the utm tag is written to the cookie.
Next, in the place where you need to display the phone number, the $_COOKIE['utm_source'] value is checked for a match with "YandexMarket" and "YandexDirect", and if it matches, a special phone number is displayed.
The problem is that in order to display the desired number, you need to refresh the page several times ...
I deleted the cache of the site and the browser.
I tried to use the solution from the marketplace "TS Non-cached area", everything is the same.
The page works with web forms that also use the $_COOKIE['utm_source'] value, when filling out these forms everything works as it should.
Thank you in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Zakharov, 2018-03-06
@pursu1t

The reason is most likely in the composite, you need to bring the output and the code to get the number into the dynamic area
, here are examples, well, keep in mind whether this is a component template or a site template
https://dev.1c-bitrix.ru/learning/course/index.php. ..

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question