Support » Plugin: Plainview Activity Monitor » Click event tracker

  • Hello,
    i need to add log when user click on any popup, i made child plugin of this it give me reults but not insert data to database so i can’t see result in list of tracking events.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author edward_plainview

    (@edward_plainview)

    You’ll have to show me the plugin you made so I can take a quick look to see if I find what’s wrong.

    Thread Starter sonali.p

    (@sonalip-1)

    This is my wp_ajax_search_result.php file.

    <?php
    namespace hooks;
    class wp_ajax_search_result extends \plainview\wordpress\activity_monitor\hooks\hook
    {
    public function log()
    {
    $link = ‘www.example.com’;
    $title = $_POST[‘pdf_ids’]; /**this is my ajax output which is comes from js file and that is right */
    $s = $this->activity_monitor()->_(‘Popup viewed: %s‘, $link, $title);
    $this->html_and_execute($s);
    }
    }

    AND this is my hooks.php file
    <?php
    /*
    Author: Sonali
    Plugin Name: Activity Monitor Example 1
    Version: 1
    */
    namespace hooks;
    class Activity_Monitor_Example_1
    {
    public function __construct()
    {
    add_action(‘plainview_activity_monitor_manifest_hooks’, [ $this, ‘plainview_activity_monitor_manifest_hooks’ ]);
    }
    public function plainview_activity_monitor_manifest_hooks($action)
    {
    require_once(‘wp_ajax_search_result.php’);
    $hook = new wp_ajax_search_result();
    $hook->register_with($action->hooks);
    }
    }

    new Activity_Monitor_Example_1();

    Plugin Author edward_plainview

    (@edward_plainview)

    That’s looks right to me. You could replace the $s part with

    $s = sprintf(‘Popup viewed: %s‘, $link, $title);
    $this->html_and_execute($s);

    Not sure if that will help.

    Thread Starter sonali.p

    (@sonalip-1)

    I replaced that, still it’s not working for me.

    Plugin Author edward_plainview

    (@edward_plainview)

    The next step in debugging would be to add some debug code that saves something to disk when the log() function is called. That way we can see whether the log function is called at all.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Click event tracker’ is closed to new replies.