我希望在PHP中成功提交表单(购买的脚本).我在PHP中找到了触发成功的函数,并且我标记了我认为分析在哪里...
function emailSuccessfullySent() {
global $translations, $lang, $options, $fdata, $is_ajax;
// redirect to custom "success" page if it's been set
if ( !empty($options['redirect_url'])) {
if (!$is_ajax) {
header('Location: '.$options['redirect_url']);
} else {
echo json_encode(array('redirect' => array($options['redirect_url'])));
}
exit;
}
// if no redirect has been set, echo out the success message
if ($is_ajax) {
echo json_encode(array('success' => array($translations->form->success->title->$lang)));
// analytics code here
} else {
echo '<h2>'.$translations->form->success->title->$lang.'</h2>';
// analytics code here
}
removeUploadsFromServer();
}
Run Code Online (Sandbox Code Playgroud)
...但是我不确定如何解雇事件JS:
ga('send', 'event', 'Form Button', 'submit', …Run Code Online (Sandbox Code Playgroud)