Exemplo n.º 1
0
 /**
  * Class constructor
  *
  * @since 2.0.0
  *
  * @param Optin_Monster_Track_Datastore $track_store The tracking datastore object
  */
 public function __construct(Optin_Monster_Track_Datastore $track_store)
 {
     $this->track_store = $track_store;
     // Provide a hook to save custom tracking data.
     do_action('optin_monster_track_optin', $track_store->get_optin_id(), 'impression');
     // Save the impression to the database.
     if (apply_filters('optin_monster_tracking', true, $track_store->get_optin_id())) {
         try {
             $this->response = $this->track_store->save('impression');
         } catch (Exception $e) {
             $this->response = $e->getMessage();
         }
     } else {
         $this->response = true;
     }
 }