Is there a supported way in Google Analytics to track a campaign without having to use query string parameters.
In Analytics you can tag a link to your site with que
You can use the Google Analytics API to customize the call to _trackPageview in your example.
pageTracker._trackPageview("/inbound/" + campaignSource + "/" + campaignMedium );
All of the inbound links will then show up in Google Analytics under the /inbound/ "pseudo directory" with a separate "directory" for Campaign Source and Campaign Medium.
The solution using push(['_set', 'campaignParams',... seems only to work for the legacy library ga.js.
Using analytics.js you need to specify the campaign param separately. E.g.
ga('set', 'campaignName', 'TheCampaignName...');
ga('set', 'campaignSource', 'someCampaignSource');
ga('set', 'campaignMedium', 'email');
https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#campaignName
I posted this to the Google help forum.
Google Please Read!!! Great enhancement opportunity!!! This is causing a lot of users not to be able to use the Advertising parameters. Allow the Advertising parameters to be read from the URL used on trackPageview(url).
In any case, without this capability, I had to use a work-around. Rather than appending the parameters to the URL. I temporarily appended them to the URL as a bookmark. Then I removed them after the trackPageview call. By adding them as a bookmark, the page is no reloaded. See the following example.
var pageTracker = _gat._getTracker(param);
var orighash = document.location.hash;
if (orighash == "") {
orighash = "none"; // this is done to prevent page scrolling
}
document.location.hash = 'utm_source='+source+'&utm_campaign='+campaign+'&utm_medium='+medium+'&utm_content='+content;
pageTracker._setAllowAnchor(true);
pageTracker._trackPageview();
document.location.hash = orighash