To track events on your website, you need to call JS API methods at the time of occurrence of any event.
In total there are three methods:
VK.Retargeting.Hit() �using the method, you can track visits to website pages. For example
<script>
VK.Retargeting.Hit();
</script>
VK.Retargeting.Event(eventName) � is a method for generating events. You yourself add a method to various website elements. For example, you can add a method call to the handler for clicking the �Sign Up" button (in this case the event name is 'click-reg-button'):
<button onclick="VK.Retargeting.Event('click-reg-button')">
Sign Up
</button>
Another example: to begin collecting users who started filling out a registration form, you need to add the event when the form is being filled out:
<script>
var formFillStarted = false;
$('form').on('change', function () {
if (!formFillStarted) {
formFillStarted = true;
VK.Retargeting.Event('form-fill-started');
}
});
</script>
VK.Retargeting.Add(audienceID)is a method for adding users to an audience. Users can be added to the audience using JS API methods. To do this, you must specify the retargeting audience ID (the audience must be previously created in the interface).
To find out the retargeting audience ID, find the audience you need in the
Audiences tab, click on its name and select
Edit rule in the drop-down menu. In the window that opens, find the audience ID.