1
votes

I'm building out a site that has predefined affiliate ids that are driving traffic to our sites. We currently use this paramater to track our seo work internally. Now we want to do the same through Google's Campaign Tracking at the Session level. The problem is we don't want to change our url, is it possible to manually build the Google campaign tracking pixel url? I'd like to take our affiliate ids and convert them over to a tracking campaign pixel for Google.

Seems like Google built this so all the tracking data must be in the url, is there a way to do the same tracking w/o the google data in the url?

Instead of:
http://www.mypage.com/?utm_source=google&utm_medium=cost-per-click

I want to use(javascript will do the rest):
http://www.mypage.com/?affid=123456

2

2 Answers

0
votes

Turns out here is exactly what I was looking for: https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiCampaignTracking

This is essentially doing everything the Google Campaign Tracking does but you have full control over what parameters are passed in the tracking pixel. I don't have to change or mess with the url, our in house tracking will work as it should, and now the google tracking pixel will be built as I specified.

0
votes

You can programmatically set up a virtual pageview based on the affiliate id.

In an if statement, determine if you have an affiliate id. If you do, write some logic to build out the proper campaign, medium and source, then concatenate it to your URL. Pass that to GA via the trackPageview method instead of letting it do it's own thing.

Keep in mind that passing a virtual URL does replace it's default behavior, so you won't have the affid parameter in your content reports unless you build it in to the virtual pageview.