Plugin Directory

Changeset 1385886


Ignore:
Timestamp:
04/04/2016 04:19:27 AM (10 years ago)
Author:
pubexchange
Message:

Added tracking to Facebook Instant Article RSS feed, if publisher uses Wordpress' official Instant Article plugin

Location:
pubexchange/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pubexchange/trunk/pubexchange_widget.php

    r1343622 r1385886  
    44 * Plugin URI: https://www.pubexchange.com
    55 * Description: PubExchange
    6  * Version: 2.0.1
     6 * Version: 2.0.2
    77 * Author: PubExchange
    88 */
     
    4646                add_action('wp_footer', array(&$this, 'pubexchange_footer_load_js'));
    4747                add_filter('the_content', array(&$this, 'load_pubexchange_content'));
     48                if ( defined( 'INSTANT_ARTICLES_SLUG' ) ) {
     49                    add_filter( 'instant_articles_content', array(&$this, 'add_pubexchange_instant_article_filter' ), 99);
     50                }
    4851            }
    4952        }
     
    166169            include_once('settings.php');
    167170        }
     171
     172        function add_pubexchange_instant_article_filter( $content ) {
     173            $content .= '<figure class="op-tracker"><iframe><script>(function(l,d){if (l.search.length){var m, u = {}, s = /([^&=]+)=?([^&]*)/g, q = l.search.substring(1);while (m = s.exec(q)) u[m[1]] = m[2];if (("pefbs" in u) && ("pefba" in u) && ("pefbt" in u)){var pe = d.createElement("script"); pe.type = "text/javascript"; pe.async = true;pe.src = "http://traffic.pubexchange.com/click/" + u.pefbt + "/" + u.pefbs + "/" + u.pefba;var t = d.getElementsByTagName("script")[0]; t.parentNode.insertBefore(pe, t);}}}(window.location, document));</script></iframe></figure>';
     174            return $content;
     175        }
    168176    }
    169177}
  • pubexchange/trunk/readme.txt

    r1343637 r1385886  
    2626* Search for PubExchange. Once found click on 'Install Now'
    2727* Select 'Activate Plugin' from the download page or go to 'Plugins' -> 'Installed Plugins' -> 'Activate Plugin'
    28 
    29 = Upgrading to >= 2.0 =
    30 * In PubExchange >= 2.0, you now need to provide a Widget Number in addition to a Widget ID. You can get this number from the PubExchange dashboard, or by contacting a PubExchange representative.
    3128
    3229= Below Article widgets =
     
    6966
    7067== Changelog ==
     68= Upgrading to >= 2.0 =
     69In PubExchange >= 2.0, you now need to provide a Widget Number in addition to a Widget ID. You can get this number from the PubExchange dashboard, or by contacting a PubExchange representative.
     70
     71== Changelog ==
     72= 2.0.2 =
     73* Added tracking to Facebook Instant Article RSS feed, if publisher uses Wordpress' official Instant Article plugin
     74
    7175= 2.0.1 =
    7276* Added Lazy Load functionality, which defers the loading of the widget until the reader scrolls down to where the widget will display
Note: See TracChangeset for help on using the changeset viewer.