Portal Engine
Version 3.x > Portal Engine > Campaign Code and Value from the API View modes: 
User avatar
Member
Member
Dave Diehl - 2/8/2010 4:25:40 PM
   
Campaign Code and Value from the API
I'm trying to use the built-in campaign tracking functionality to do some custom processing. I need to access the code passed in the query string but it doesn't seem to appear in the API as I would expect.

If:
- The campaign code setting is the default "campaign", and
- I use the following URL "http://www.foobar.com?campaign=JellyBeans"

Shouldn't the value passed be available in CMSContext.Campaign? If not, where? Is there something I'm missing?

Thanks in advance!

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 2/13/2010 1:48:07 PM
   
RE:Campaign Code and Value from the API
Hi Dave,

could you please make sure the campaign tracking is enabled for the site in settings?

You can also use QueryHelper class to get generally any parameter from query string, e.g.:

CMS.GlobalHelper.QueryHelper.GetString("campaign", "");

(second parameter is default value that is returned if query string is not found in url)

Best Regards,

Martin Dobsicek