1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51:
<?php
class Inbound_Mailer_Tracking {
public function __construct() {
self::load_hooks();
}
public static function load_hooks() {
add_action( 'inbound_track_link', array(__CLASS__, 'track_link'));
}
public static function track_link( $args ) {
$do_not_track = apply_filters('inbound_analytics_stop_track', false );
if ( $do_not_track || !isset($args['email_id']) || !$args['email_id'] ) {
return;
}
$args['page_id'] = (isset($post) && $post->ID ) ? $post->ID : 0;
$args['email_id'] = $args['email_id'];
$args['lead_id'] = $args['lead_id'];
$args['variation_id'] = (isset($args['vid'])) ? $args['vid'] : 0;
$args['event_details'] = json_encode($_GET);
do_action('inbound_email_click_event' , $args );
}
}
$Inbound_Mailer_Tracking = new Inbound_Mailer_Tracking();