WordPress.org

Forums

Plugin not tracking (2 posts)

  1. el terrible bmw
    Member
    Posted 3 years ago #

    My client uses this "ExitSplash" plugin that's supposed to track when people initiate an exit popup. Anyways, on his server, it's not tracking, while on my server, it works fine. I moved the database and all the files are 100% identical. Any reason why it wouldn't work? Here's the plugin's file that generates a 1px image which is used for tracking. I've tried everything and it all points to some server setting being off on his host. Any suggestions would be GREATLY GREATLY appreciated as I've gone half-crazy trying to figure out this plugin.

    <?php
    /*
    ExitSplash Plugin stats tracking
    */
    $type = $_GET['t'];
    $pid = $_GET['pid'];
    if (isset($pid)){	
    
    	require_once("../../../wp-config.php");
    	global $wpdb;
    
    	//this records an exit initiation and stores it in the corresponding exit record in the database
    	if ($type == 'init'){	
    
    		$sql = "UPDATE ".$wpdb->prefix."exit_splash SET close_window_exitinits=close_window_exitinits+1 WHERE id='".$pid."'";
    		$wpdb->query($sql);
    
    		//set a cookie for this given initiation used for tracking
    		setcookie("exitsplash_tracking".$pid, $pid, time()+60*60*24*100, "/");
    
    	}else if ($type == 'action'){
    
    		//only record this action if cookie exists, to avoid duplicate actions
    		if ($_COOKIE['exitsplash_tracking'.$pid]){		
    
    			//this records an action from the action tracking link for the given exit page record in the database
    			//need to determine if this is an internal page/post page, and only increment if this exit is enabled
    			$theexit = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM ".$wpdb->prefix."exit_splash WHERE id = $pid" ) );
    			if ($theexit->close_window_mainpagerb == 1){ //internal
    				if ($theexit->close_window_state == 1){ //exit enabled
    					$sql = "UPDATE ".$wpdb->prefix."exit_splash SET close_window_actions=close_window_actions+1 WHERE id='".$pid."'";
    					$wpdb->query($sql);
    				}
    			}else{
    				//external exit page
    				$sql = "UPDATE ".$wpdb->prefix."exit_splash SET close_window_actions=close_window_actions+1 WHERE id='".$pid."'";
    				$wpdb->query($sql);
    			}//end $theexit	
    
    			//delete this cookie
    			setcookie("exitsplash_tracking".$pid, "", time()-60*60*24*100, "/");
    
    		}//end cookie
    
    	}//end type
    }
    ?>

    This is the HTML code that loads on the page which initiates the tracking.

    <div id="ExitSplashTrackingPixel"><img width="1" border="0" height="1" src="http://www.domain.com/wp-content/plugins/exitsplash/dbedit.php?pid=1&t=init&1331700559307"></div>

  2. el terrible bmw
    Member
    Posted 3 years ago #

    I compared the PHP configs of the two servers, and 2 things stood out. On the one where it works, these things are turned on:

    • Magic Quotes GPC
    • MySQL Persistent Connection

    Do you guys think that could be causing this tracking to work on one server but not the other?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.