Example #1
0
function dh_ptp_usage_tracking_pointer_ajax()
{
    if (!wp_verify_nonce($_POST['nonce'], 'dh_ptp_activate_tracking')) {
        die('No tricky business!');
    }
    $result = $_POST['allow_tracking'] == 'yes' ? 'yes' : 'no';
    if ($result == 'yes') {
        if (function_exists('dh_ptp_track_event')) {
            dh_ptp_track_event('Plugin activated');
        }
    }
    update_option('dh_ptp_allow_tracking', $result);
    exit;
}
Example #2
0
function dh_ptp_crash_course($var)
{
    if (function_exists('dh_ptp_track_event') && get_option('dh_ptp_allow_tracking') == 'yes') {
        dh_ptp_track_event('Email course button clicked', array('Button copy' => $var));
    }
}