• Resolved worldofcredence

    (@worldofcredence)


    Hello.

    Spamassassin’s recent rule URI_WP_HACKED_2 takes away 1.92 points from an e-mail’s total score if said e-mail contains links to locations inside:

    wp-content/plugins/
    wp-content/themes/
    wp-includes/
    modules/
    includes/
    mt-static/
    data/module/

    Is there a way to change the AloEasyMail Pixel Location to another place using custom hooks? How, eventually?

    Thanks.

    Marco.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author eventualo

    (@eventualo)

    Hi Marco, you can disable the default tracking pixel in plugin setting page, then you can use the newsletter content filter to add your tracking pixel.
    This is a quick sample, just a starting point:

    
    function custom_alo_em_tracking_pxl ( $content, $newsletter, $recipient ) {
    	
    	// If $recipient is not defined, don't track (e.g. it's a test email)
    	if ( isset( $recipient->ID, $recipient->unikey ) ) {
    		
    		// This is the default tracking by EasyMail: replace with yours
    		$track_vars = $recipient->ID . '|' . $recipient->unikey;
    		$track_vars = urlencode( base64_encode( $track_vars ) );
    		$tracking_view = '<img src="'. ALO_EM_PLUGIN_URL .'/tr.php?v='. $track_vars .'" width="1" height="1" border="0" alt="" >';
    		
    		// Insert tracking img before </body> if tag exists, otherwise at the end
    		if ( strpos( $content, "</body") !== false ) {
    			$content = str_replace( "</body", $tracking_view ."\n</body" , $content );
    		} else {
    			$content .= $tracking_view;
    		}
    	} 
    	
    	return $content;
    }
    add_filter ( 'alo_easymail_newsletter_content',  'custom_alo_em_tracking_pxl', 20, 3 );
    

    I hope it helps.

    • This reply was modified 5 years, 7 months ago by eventualo.
    Thread Starter worldofcredence

    (@worldofcredence)

    Thank you for your help, Alo!

    Tracking pixel is added all right, Spamassassin treats it like a normal image.

    Unfortunately, it doesn’t track.

    I copied tr.php to website root folder, changed “no” to “yes” in the line below,

    if ( get_option(‘alo_em_use_tracking_pixel’) == ‘yes’ ) exit;

    but it doesn’t track.

    I’ll have to check something else…

    Thanks.
    Marco.

    Thread Starter worldofcredence

    (@worldofcredence)

    Tracking works all right.

    wp_load pointed to non-existent directory ( was ../../../wp-load.php).

    define(‘WP_USE_THEMES’, false);
    include(‘wp-load.php’);

    Thanks again.

    Marco

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Tracking Pixel Location.’ is closed to new replies.