• Hello

    Is it possible to limit the plugin only to certain pages e.g. by custom template and placed code or a header footer plugin
    Alternatively through a hook filter?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor helened

    (@helened)

    I’m afraid WassUp is designed to do the opposite..that is, track everything except for some pages(urls) listed in Options->Filters & Exclusions >> Exclude by URL request.

    That said, theoretically you could do it with a hack of your WordPress theme footer.php file. If you are familiar with coding, here’s how:

    • disable statistics recording in Wassup >>Options >>General Setup tab and save
    • edit your themes footer.php file and add this code near the bottom:
      <?php
      	  if( function_exists('wassupAppend') ){ //Wassup is installed
      	  	global $wassup_options;
      	  	$current_page_id = get_queried_object_id();
      		if( in_array($current_page_id, array(101,102,103,104)) ){
      	  		$wassup_options->wassup_active=1; //enable tracking
      			wassupAppend();
      	  		$wassup_options->wassup_active=0; //disable tracking
      		}
      	  }
      ?>

      Replace the array numbers shown with the post_ids of the pages/posts you want Wassup to track. You can add more post-ids, but make sure that there is a comma between each number.

    Be warned, though, this hack might not work and editing code risks breaking your site.

    Thread Starter WP-Henne

    (@wp-henne)

    Hello @helened
    THX, i’ll try at my testside!

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘on certain pages only?’ is closed to new replies.