monsterinsights_rss_link_tagger

Add the UTM source parameters in the RSS feeds to track traffic.

Description

(string) monsterinsights_rss_link_tagger( (string) $guid ); 

Returns (string)

The new link for the RSS feed.

Parameters (1)

0. $guid (string)
The link for the RSS feed.

Usage

  1. if ( !function_exists( 'monsterinsights_rss_link_tagger' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-analytics-for-wordpress-by-monsterinsights/includes/frontend/frontend.php'; 
  3.  
  4. // The link for the RSS feed. 
  5. $guid = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = monsterinsights_rss_link_tagger($guid); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/frontend/frontend.php  
  1. function monsterinsights_rss_link_tagger( $guid ) { 
  2. global $post; 
  3.  
  4. if ( monsterinsights_get_option( 'tag_links_in_rss', false ) ) { 
  5. if ( is_feed() ) { 
  6. if ( monsterinsights_get_option( 'allow_anchor', false ) ) { 
  7. $delimiter = '#'; 
  8. } else { 
  9. $delimiter = '?'; 
  10. if ( strpos( $guid, $delimiter ) > 0 ) { 
  11. $delimiter = '&'; 
  12. return $guid . $delimiter . 'utm_source=rss&utm_medium=rss&utm_campaign=' . urlencode( $post->post_name ); 
  13. return $guid;