D
D
De1f2019-06-06 16:56:36
JavaScript
De1f, 2019-06-06 16:56:36

Goal in metric through function?

Good afternoon, there is a site on vp, there is a Form Maker module, so there is no access to the code of the form itself, the module has a javascript tab with content (below), is it possible to somehow set up the target using js?

// Occurs before the form is loaded
function before_load() {
     
}

// Occurs just before submitting  the form
function before_submit() {
     
     // IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don't need to return any value if you don't want to stop the submission.
}

// Occurs just before resetting the form
function before_reset() {
     
}
// Occurs after form is submitted and reloaded
function after_submit() {
     
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2019-06-07
@lebonnet

I don’t understand the problem, there are js hooks in the names of which everything is said, if they really work with the desired form, then we go to the dock i.metrics , the code for js
How to check that the hooks work, we write:

function before_load() {
    console.log('before_load');
}
function before_submit() {
    console.log('before_submit');
}
function after_submit() {
    console.log('after_submit');
}

open the page, press f12 (developer tools), then the console tab, press ctrl + shift + r (thus resetting the page cache).
When loading the form, before_load will be written in the console, before submitting the form before_submit, after after_submit.
If the console is empty, then these hooks do not work, and a different approach is needed, any of at least 10 ways.
If the hooks are working, then there (in before_submit || after_submit) you need to insert the code from the link above (reachgoal.html).
If any of the above is not clear, then you need to find a person who understands the web at least a little.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question