narkq / react-yandex-metrika

React component for Yandex.Metrika
128 stars 25 forks source link

Metrika's Webvisor 2.0 #6

Closed vladimirlogachev closed 7 years ago

vladimirlogachev commented 7 years ago

Metrika's Webvisor 2.0 requires changes in code. Here is what I've noticed about it:

Before: w.yaCounterXXX = new Ya.Metrika({ After: w.yaCounterXXX = new Ya.Metrika2({

Before: s.src = "https://mc.yandex.ru/metrika/watch.js"; After: s.src = "https://mc.yandex.ru/metrika/tag.js";

Before: })(document, window, "yandex_metrika_callbacks"); After: })(document, window, "yandex_metrika_callbacks2");

Can we expect this Component to change? Or is there a way to set it up without changing code?

Anyways, thank you for your work.

narkq commented 7 years ago

Or is there a way to set it up without changing code?

Not yet.

Can we expect this Component to change?

Sure! I would do that in a straightforward approach: introduce a version prop to the initializer component. But still, I'd like to have a documentation on these changes, or at least a way to test my new code. If I make those changes, would you like to test the new version yourself? (Since I don't have an access to the 2.0 version yet.)

vladimirlogachev commented 7 years ago

I'd like to test it on my site with standard «check if counter is installed» icon, of course. It reacts on 2.0 changes. But I don't know if there is something else changed in their API, so I can't help a lot. I'm only using these parameters:

      <YMInitializer 
        accounts={[XXXX]} 
        options={{
          clickmap: true,
          trackLinks: true,
          accurateTrackBounce: true,
          webvisor: true,
          trackHash: true,
        }} />
narkq commented 7 years ago

Got it. Will do that some time later today or tomorrow.

narkq commented 7 years ago

I've just published v2.1.0, please check it out.

vladimirlogachev commented 7 years ago

Thank you, it works!