Campaign Tracking

How to implement campaign tracking using javascript tracker?
I want separate parameter values for eg: utm_source=newsletter-october&utm_medium=email&utm_campaign=cn0201 .Can I get values of these parameters?how?

You don’t need to configure anything on the client side.

Have you enabled the campaign attribution enrichment?

2 Likes

I already enabled campaign attribution enrichment and clicked one link which contains utm_source,utm_medium using javascript tracker but value of mkt_source and mkt_medium is not getting populated.

Using this in campaign attribution
{
“schema”: “iglu:com.snowplowanalytics.snowplow/campaign_attribution/jsonschema/1-0-1”,

"data": {

	"name": "campaign_attribution",
	"vendor": "com.snowplowanalytics.snowplow",
	"enabled": true,
	"parameters": {
		"mapping": "static",
		"fields": {
			"mktMedium": ["utm_medium"],
			"mktSource": ["utm_source"],
			"mktTerm": ["utm_term"],
			"mktContent": ["utm_content"],
			"mktCampaign": ["utm_campaign"]
		}
	}
}

}

As @robkingston has mentioned above, if you have the campaign attribution enrichment enabled this should do it for you automatically. It looks like there is also nothing incorrect with the configuration above.

What URL are you currently sending in?

Hi @mike thanks for rply

http://mysite.com/myproduct.html?utm_source=newsletter-october&utm_medium=email&utm_campaign=cn0201

This is the url I am using

That’s the example from the Snowplow docs so that should work without any issues. Could you share the Javascript code you are using to initialise the tracker and send the event?

This is my tracker

window.snowplow(‘newTracker’, ‘cf’, ‘localhost:1234’, { // Initialise a tracker
appId: ‘3807cb5a5475c400’,
cookieDomain: ‘localhost’,
post: true
});

window.snowplow(‘enableLinkClickTracking’, {‘blacklist’: [‘unbarred’, ‘tracked’]});

Visit website

and this is how calling link.

No track page view? You need to record an event such as a page view for the data to be recorded.

Its working.thanks @robkingston @mike