D
D
Dmitry Aiteks2016-06-03 19:13:38
JavaScript
Dmitry Aiteks, 2016-06-03 19:13:38

Dynamic titles. Bad or Good?

Tell me, has anyone used dynamic titles that change depending on the region, with the connection of the Yandex map api. For example:
<title>Торты</title>

if (YMaps.location.city != '') {
        var youRegion = (YMaps.location.city);
        if (youRegion === "Новосибирск"){
          $("#title").html("ТОРТЫ НА ЗАКАЗ В НОВОСИБИРСКЕ");
        } else if (youRegion === "Санкт-Петербург"){
          $("#title").html("ТОРТЫ НА ЗАКАЗ В САНКТ-ПЕТЕРБУРГЕ");
        } else if (youRegion === "Екатеринбург"){
          $("#title").html("ТОРТЫ НА ЗАКАЗ В ЕКАТЕРИНБУРГЕ");
        } else if (youRegion === "Нижний Новгород"){
          $("#title").html("ТОРТЫ НА ЗАКАЗ В НИЖНИЙ НОВГОРОДЕ");
        } else if (youRegion === "Казань"){
          $("#title").html("ТОРТЫ НА ЗАКАЗ В КАЗАНИ");
        } else {
          $("#title").html("ПРОИЗВОДСТВО ТОРТОВ НА ЗАКАЗ");
        }
      }

Who had the practice of using this example, please tell us about the effectiveness.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2016-06-03
@xmoonlight

TO NIZHNY NOVGOROD
I have to speak Russian!)))
Simple answer: Google and Yandex execute JS only when caching in their database. Accordingly, only one line will be in the search from the entire list.
This option is useless for search results, but useful for users if you change not the title, but the text on the page that the user sees, because. it increases the conversion.
For PS: if you change the title, change the link and text as well.
If the text remains the same, you need to use the canonical tag to indicate the original link to the material.

R
Rou1997, 2016-06-03
@Rou1997

The next question, which boils down to "do search engines execute JavaScript", yes, Google and Yandex do, since they are developed by the same people as browsers, you can double-check with Webmaster, but ideally, of course, the region should be determined on the server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question