How to use the Products Variable in SiteCatalyst
I’ve been writing a bit about SiteCatalyst in the last couple of months, so I thought I’d continue that trend by doing a bit of demystifying of the Product variable in SiteCatalyst. This is a variable that can be used in hundreds of different ways, but would be best described as an eVar with an expiration period of the page view.
Products more importantly allow you to set your event variables to have a value of something other than one. This is important because you don’t always want your events to be equal to one. Most importantly you don’t want them to equal one in situations where they represent revenue, but there are many other situations as well (eg when you are selling something and you ask the user how many they want of them).
So lets break down how they work in some simple steps:
1. Set the event(s) at the same time as the Products
Because Products are like eVars that expire after a page view, you have to set your events that you want related to your products in the same part of the call as your Products. If you set them at a different point, then they won’t be associated with the Products and it will be a bit of a waste. This means that if you set them in a normal page view then you put one above the other, but if you put them in a call in an onclick event then you need to make sure they go in there together as well:
s.events = “event1,event2”
s.products = “; ; ; ;”
s.events = “event1,event2”
s.products = “; ; ; ; event1=10 | event2=-3.3”
This convenient example above sets event1 to be 10 and event2 to be -3.3. Of course the other part of this is that in your admin section you also need to set your events to be numeric or currency based so that they’ll work properly.
Where would you use this? Well it is most importantly used when it comes to revenue (more of than later). It allows you to tell SiteCatalyst how much the product the user has just bought is worth. So if you have products with different revenues, you can get a total revenue without having to set the value in SiteCatalyst. It’s also important for situations where you have ‘units’ (although more of this later) and you want to specify how many of the units the user wanted.
This ‘units’ option can be applied to various different situations of course. Did your user sign up to two different newsletters in one page? Did they choose to have four different brochures sent to them, did they apply for a coupon that was worth £15 off, etc, etc.
Of course the next advantage of this is that you can use one of your events as a counter (‘orders’ if you want) that goes up one at a time, alongside your numeric or currency based event. This will allow you to create a calculated event of average revenue per order or units per order.
2. Set your Products
The products themselves seem like they should be easy. You just set them in the same way that you would do with your custom conversion variables, right?
Well not quite, as you can see by the above. To allow for this, Products uniquely have a number of different variables that you have to set within them, each separated with a semi colon:
s.products = “[category] ; [products] ; [quantity] ; [total Cost] ; [incrementor] ; [merchandising]”
We’ve already looked at the incrementor variable above, by making use of the event variables to set a value of more than one.
The other variables are the more important ones though. I say the other variables are the important one, but actually the first of them, the category value is something that has been obsoleted by the introduction of SAINT classifications. Being able to classify your products in the user interface means that setting the categories in the code becomes a coding nightmare that is difficult to maintain.
This brings us nicely along to the products variable. This, obviously, is where you want to put the thing that the user is buying or that you want your events to convert against. Given that you can use SAINT classifications it is often easier to user product codes in the coding and then convert these to friendly names later in the process.
Conveniently for you, SiteCatalyst has a number of out-of-the-box conversion variables: Orders, Revenue and Units. To activate these ‘events’ you just need to specify that you are using the ‘purchase’ event and then let the products do the rest. This will automatically mean that for a particular products value you will have one order, you will have quantity turned into units and you will have total cost turned into revenue.
This means that if you don’t want to use the standard variables, you need to use your incrementor variable to set the units and revenue.
The merchandiser variable is an interesting way of setting custom conversion variables that are pinned to the specific product (more of this in a second).
3. Set Multiple Products
The advantage of products is that you can set many of them on the same page. All you need to do is separate them with a comma.
This makes it easy to split things up when a user has lots of different things in an order.
Why do I mention this? Well, it comes in quite handy when thinking about the merchandising section. If you have an order where some of the things are next day delivery and some are 7 day delivery then you can specify each of these by using the values in the merchandising section.
s.products = ” ; freshfish ; 1 ; 10 ; event2=1 ; evar1=nextday , ; shoes ; 1 ; 40 ; event2=1 ; evar1=7days”
In my fictional example above we have someone who has ordered fresh fish and shoes. The fresh fish is due for next day delivery (we don’t want it going off!) and the shoes come in seven days time. We’ve put this information into an eVar so that we can tell which is going for which. You can then break down your orders that are due the next day by which product they want.
An alternative situation would be where you get the user to enter responses to a number of questions to get a recommendation. You could use your product as each of the quizzes and set the responses in an evar. You can then break down one by the other to find out what answers people are giving to each of the quizzes.
So there you have it. Many ways which you can use the products variable.