Forum Replies Created

Viewing 15 replies - 1 through 15 (of 46 total)
  • This issue is back in 2.3.2…

    I’m not sure what this is supposed to do, but I had to hack it to make it work:

    $(".topbar_container + .site-header").css("margin-top", theight );

    Thread Starter linkhousemedia

    (@linkhousemedia)

    Beautiful! Thanks so much, Hugh! Will leave a review for sure.

    I’ve managed to get some pretty solid tracking using some filters and Google analytics events. I’m also using cloudflare so I’ve added some extra IP address stuff.

    I’m using this php library to help with this: https://github.com/ins0/google-measurement-php-client

    /*-----------------------------------------------------------------------------------*/
    /* Add analytics tracking to our podcast downloads */
    /*-----------------------------------------------------------------------------------*/
    function podcast_analytics($file){
    
    	require_once(dirname(__FILE__).'/src/Racecore/GATracking/GATracking.php');
    
    	$client_ip = $_SERVER["HTTP_CF_CONNECTING_IP"] ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER['REMOTE_ADDR'];
    	$options = array(
    	    // use proxy
    	    'proxy' => array(
    	       'ip' => $client_ip
    	    )
    	);
    
    	$gatracking = new \Racecore\GATracking\GATracking('your-analytics-id-here', $options);
    
    	$f      = str_replace('https://example.com/','',$file);
    	$page 	= $gatracking->createTracking('Factory', array(
    	    'dh' => 'example.com',
    	    'dp' => $f,
    	    'dt' => $file
    	));
    
    	$event = $gatracking->createTracking('Event');
    	$event->setAsNonInteractionHit(false);
    	$event->setEventCategory('Audio');
    	$event->setEventAction('Plays');
    	$event->setEventLabel($f);
    
    	$response = $gatracking->sendMultipleTracking(array(
    	    $page, $event
    	));
    
    }
    add_action('ssp_file_download', 'podcast_analytics');
    /*-----------------------------------------------------------------------------------*/
    /* Add some Analytics tracking to our podcast feed 									 */
    /*-----------------------------------------------------------------------------------*/
    function track_podcast_xml(){
    
    	require_once(dirname(__FILE__).'/src/Racecore/GATracking/GATracking.php');
    
    	$client_ip = $_SERVER["HTTP_CF_CONNECTING_IP"] ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER['REMOTE_ADDR'];
    	$options = array(
    	    // use proxy
    	    'proxy' => array(
    	       'ip' => $client_ip
    	    )
    	);
    
    	$gatracking = new \Racecore\GATracking\GATracking('your-analytics-id-here', $options);
    
    	$page 	= $gatracking->createTracking('Factory', array(
    	    'dh' => 'example.com',
    	    'dp' => 'feed/podcast',
    	    'dt' => 'feed/podcast'
    	));
    
    	$event = $gatracking->createTracking('Event');
    	$event->setAsNonInteractionHit(false);
    	$event->setEventCategory('XML');
    	$event->setEventAction('FeedHit');
    	$event->setEventLabel('feed/podcast');
    
    	$response = $gatracking->sendMultipleTracking(array(
    	    $page, $event
    	));
    
    }
    add_action('ssp_before_feed', 'track_podcast_xml');
    Thread Starter linkhousemedia

    (@linkhousemedia)

    Sorry about the duplicate posts. My fault! Changing this to resolved.

    Thread Starter linkhousemedia

    (@linkhousemedia)

    Thank you! That would be great. I definitely don’t want a square used for my featured image on the theme. Of course I could let wordpress crop things on the front end (which will be a good workaround for now actually).

    Thanks for the awesome plugin and sorry about the duplicate posts.

    Thread Starter linkhousemedia

    (@linkhousemedia)

    If you could re-open this that would be great. The forum isn’t letting me re-post it for some reason. Thanks!

    Thread Starter linkhousemedia

    (@linkhousemedia)

    In case anyone is wondering, I’ve solved this. You can easily track your XML feed hits by doing the following:

    /*-----------------------------------------------------------------------------------*/
    /* Add some Analytics tracking to our podcast feed */
    /*-----------------------------------------------------------------------------------*/
    function track_podcast_xml(){

    require_once(dirname(__FILE__).'/src/Racecore/GATracking/GATracking.php');

    $client_ip = $_SERVER["HTTP_CF_CONNECTING_IP"] ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER['REMOTE_ADDR'];
    $options = array(
    // use proxy
    'proxy' => array(
    'ip' => $client_ip
    )
    );

    $gatracking = new \Racecore\GATracking\GATracking('UA-XXXXXXXX-X', $options);

    $event = $gatracking->createTracking('Event');
    $event->setAsNonInteractionHit(false);
    $event->setEventCategory('XML');
    $event->setEventAction('FeedHit');
    $event->setEventLabel('feed/podcast');

    $response = $gatracking->sendTracking($event);

    }
    add_action('ssp_before_feed', 'track_podcast_xml');

    Side note: I’m using CloudFlare, so you’ll notice the $_SERVER["HTTP_CF_CONNECTING_IP"] header check.

    Cheers.

    Great fix. Thank you.

    Someone should pick this back up. I wonder what the process would be for that.

    Thread Starter linkhousemedia

    (@linkhousemedia)

    [UPDATE]: My client had a .tiff file in their media library. WordPress will safely ignore it, but I think your plugin was soiling itself over it.

    Might want to add a check for that.

    Cheers.

    Thread Starter linkhousemedia

    (@linkhousemedia)

    Great, thanks!

    Thread Starter linkhousemedia

    (@linkhousemedia)

    Thanks @mattyrob, but my needs ended up being too specific and I built my own little digest email system based on user roles.

    I do appreciate all of the help.

    Thread Starter linkhousemedia

    (@linkhousemedia)

    I think I know what’s happening here. I could be wrong, but I don’t think your plugin filters users for the digest email – only for the per-post emails. I’ve looked at both the publish() and subscribe2_cron() functions, and only in publish does the filtering come into play.

    Am I missing something? If I’m right, would you consider adding this functionality to the digest option? If you have a github repository I’d be happy to fork a change.

    Thanks for all of the continued support!

    Thread Starter linkhousemedia

    (@linkhousemedia)

    Okay thanks.

    Hopefully last question – I don’t think the filters are firing. I added a piece of code that should kill the entire process and nothing happened. Where do I put these filters? Do they have to go inside an init action or something? Right now, my code is just sitting in the theme’s functions.php file.

    Thread Starter linkhousemedia

    (@linkhousemedia)

    Hmmm. Okay I appreciate that test. Thanks!

    Perhaps my get_field() (from the advanced custom fields plugin) isn’t firing. I’ll try using post_meta instead to grab that meta value.

    Per my other post, do you have a function I can fire for development to force the digest? Even a simple hack that I can undo when I’m finished?

    Thanks for everything!
    Jay

    Thread Starter linkhousemedia

    (@linkhousemedia)

    @mattyrob,

    Any reason you can see that this would stop sending emails altogether?

    function s2member_filter($subscribers, $post_id) {
    
        //Who can see this post?
        $whosee = get_field('who_can_view', $post_id);
    
        // $subscribers is an array of subscriber email addresses
    	foreach ( $subscribers as $subscriber_email ) {
    		$user_info = get_user_by( 'email', $subscriber_email );
    		$user_role = $user_info->roles[0];
    		$user_email = $user_info->data->user_email;
    
    		if ( $user_role == 'subscriber' || $user_role == 'author' || $user_role == 'contributor' || $user_role == 'editor' ) $user_role = 'member';
    
    		if ( $user_role == $whosee || $user_role == 'leadership_team' || $user_role == 'administrator' ) $allow_post[] = $user_email;
    	}	
    
        $filtered_subscribers = array_intersect($subscribers, $allow_post);
    
        return $filtered_subscribers;
    
    } // end s2member_filter()
Viewing 15 replies - 1 through 15 (of 46 total)