I’m facing the same questing. I use my RSS feed for multiple services (Twitterfeed, facebook, e-mailnewsletter using RSS). For each servive, I want to change the utm_source.
Is there an existing plugin for this?
Alternatively, we could create a PHP-script, which pulls down the original feed, and replaces the values. This script must then be used as the RSS-endpoint.
Ah, screw it, I did it Myself allready. One note, the utm_’s were added twice by the plug-in(s). Therefore, you might want to modify $original_string to your situation.
<?
$data = file_get_contents("http://www.yoursites.tld/feed");
$utm_source = "";
$utm_medium = "";
$utm_campaign = "";
if (array_key_exists("utm_source", $_REQUEST)) $utm_source = $_REQUEST["utm_source"];
if (array_key_exists("utm_medium", $_REQUEST)) $utm_medium = $_REQUEST["utm_medium"];
if (array_key_exists("utm_campaign", $_REQUEST)) $utm_campaign = $_REQUEST["utm_campaign"];
$original_string = "utm_source=rss&utm_medium=rss&utm_campaign=rss&utm_source=rss&utm_medium=rss&utm_campaign=rss";
$new_string = "";
if ($utm_source != "") $new_string .= "utm_source=".urlencode($utm_source)."&";
if ($utm_medium != "") $new_string .= "utm_medium=".urlencode($utm_medium)."&";
if ($utm_campaign != "") $new_string .= "utm_campaign=".urlencode($utm_campaign);
$data = str_replace($original_string, $new_string, $data);
echo $data;
?>
@gerritduits: thanks for this solution. Can you please explain what you mean with ‘One note, the utm_’s were added twice by the plug-in(s). Therefore, you might want to modify $original_string to your situation.’? I’m not certain what this implies for me. Thanks in advance!
My problem is that Google sees as duplicate URLs. For ex:
http://mysite.com/keyword1/keyword2/
and
http://mysite.com/keyword1/keyword2/?utm_source=rss&utm_medium=rss&utm_campaign=keyword2
In Google Webmaster Tools it says that these two are pages with duplicate metadescription and duplicate title. Is this a major problem???
And if it is what should I do?? I am waiting for an answer. Thank you.