Plugin for configuring the counter and Yandex Metrica goals.
Plugin for configuring the counter and Yandex Metrica goals.
Supports the following counter settings:
Loading by event:
Embedding in HTML:
Easy goal setting for:
Error control
When working with goals on the user side, the plugin monitors the correct indication of CSS selectors.
JavaScript with a syntax violation does not cause an error, but fixes it in the browser console (F12).
Goal #1. SyntaxError: Failed to execute ‘querySelectorAll’ on ‘Document’: ‘.class 777’ is not a valid selector.
To see information about errors, in the plugin settings, enable the “Error control in the browser console” option.
Contact me at Telegram.
Before adding a goal, you need to create it in Yandex Metrica.
Phone
<a href="tel:7XXXXXXXXXX">+7 (XXX) XXX-XX-XX</a>
<a href="https://wa.me/7XXXXXXXXXX">+7 (XXX) XXX-XX-XX</a>
If your WhatsApp link looks like “https://wa.me/7XXXXXXXXXX?text=Text&source=&data=”, in the goal settings, specify “https://wa.me/7XXXXXXXXXX”. The script will still find the desired link on the page.
Form
<form id="id_form" class="class-form" … >…</form>
Button
<button id="id_button" class="class-button">…</button>
Link
<a href="https://example.com/path/sub/?param=value¶m1=value">example.com</a>
The link can be as full as “https://example.com/path/sub/?param=value¶m1=value”, and short “https://example.com/path/sub/”, the script will still find it on the page. As GET parameters, the Cyrillic alphabet is not allowed.
HTML tag
Allows you to set complex CSS selectors: header .contacts > div:nth-child(3) a[href= “tel:7XXXXXXXXXX”].
Header
<header> … <a href="tel:7XXXXXXXXXX">+7 (XXX) XXX-XX-XX</a> … </headre>
Footer
<footer> … <a href="tel:7XXXXXXXXXX">+7 (XXX) XXX-XX-XX</a> … </footer>
Sidebar
<aside> … <a href="tel:7XXXXXXXXXX">+7 (XXX) XXX-XX-XX</a> … </aside>
Content
<article> … <a href="tel:7XXXXXXXXXX">+7 (XXX) XXX-XX-XX</a> … </article>
There can be many variations, and you don’t have to link to header, footer, aside, or article. You can use .class or #id, as long as the selector belongs to the parent element of the HTML markup.
.content a[href="tel:7XXXXXXXXXX"]
<div class="content"> … <a href="tel:7XXXXXXXXXX">+7 (XXX) XXX-XX-XX</a> … </div>
Table
<table> … <button>Order</button> … </table>
Block layout
<div class="price"> … <a class="order">Order</a> … </div>