The forgotten goal tracker ?sc_trk=

OMG! 7+ years of asking the same basic question over and over again. How do I add a Goal to a user interaction!? Same answer, with added functionality.

No more – Say hello to ?sc_trk

7 years of looking for a valid and simple solution, and it turns out the solution has been around since at least Sitecore 6.5. How come I missed it, and maybe many of you as well.

Ok, you might think I am mad blogging about this. But I assure you that you will be as happy as me when you see what doors ?sc_trk opens.

Lets take it from the beginning

Goal and event tracking in Sitecore can be implemented in multiple ways. Most often it is done by adding goals to pages that trigger when a visitor views a page, when a visitor is added to an engagement plan, sign up for a newsletter or trough downloading a file. All this is fine and dandy, and require some planning and often a small implementation effort. But mostly, it´s a process that you as an editor need to plan for to implement.

A page goal is added to a page and is triggered every time a visitor loads that page.

But as good as this is I have always felt that there is something missing. As long as I follow the steps and implement goals and events, most of my pages are giving valuable feedback on the goals I set in place.

But if I would like to trigger a goal on a CTA, banner or any regular link. What then?

Imagine, Code, deploy and repeat

I have always been told that a goal only can be triggered on certain criteria’s or predefined actions. When I try to track a CTA the answer is: We need to develop that functionality.

For me as an editor that is a disheartening answer, as this means that I can´t do what I perceive as something simple. It´s something that I need to get developed to be able to do.

Im not saying that this is an issue, but it raises the threshold of what I am able to set in place.

The solution – ?sc_trk

The lost code of the ancient past

I have finally found a solution to this small but in my perspective deal breaking lack of a feature. It looks like it never was missing, just hidden deep down in the Sitecore dungeons. This functionality has been around since at least Sitecore 6.5 and is a function that allow us to add a specific query at the end of a url that will trigger any goal we set.

If we add ?sc_trk={goal GUID or Goal name} at the end of a url it will actually call all necessary functions to trigger the goal that it refers to.

By adding ?sc_trk= to the query string parameter on a CTA url a goal can be triggered.

So by doing this we are actually able to trigger a Goal trough the use of a simple URL query string.

This neat little trick will enable us to track much more than we would be able to without it, or to be correct – Without Imagine, Code, deploy and repeat!


Be sure to create Goals that are unique and easily distinguishable so that you can look at and analyze how well your banners, cta´s and in page conversion perform.

So try it out and see for yourself, I hope it will change the way you work as much as it has mine. Use it on the standard Query String-field on any ahref link element. It works!

Good luck!

Add the query to the next link you create and see that you now are able to track clicks to goals.