Sending additional parameters¶
5 parameters are currently available:
- param1
- param2
- param3
- param4
- param5
Ways to set and send the parameters:
Setting parameters globally¶
r7k12.push({set: {param1: ‘value1’,param2: ‘value2’,.....}});
This means these parameters will be written into every request that is sent. They must be set before the request is sent. Example:
r7k12.push({set: {param1: ‘value1’}});
r7k12.push({hit:‘pageview’});
r7k12.push({hit:‘event’});
param1=value1 will be sent with both the pageview and the event
Setting a variable for a specific request only¶
r7k12.push({event:‘pageview’,data:{param1:’value1’}});
I.e. param1 will be sent only in this request, so if an event follows, it will be sent without param1 (if paramN is missing, it is not cleared for the session; to clear it, you need to pass an empty paramN); Example:
r7k12.push({hit:‘pageview’,data:{param1:’value1’}});
r7k12.push({hit:‘event’});
pageview will be sent with param1=value1, and event without it The second option is preferable, because with several requests from one page the parameter would be sent repeatedly, which makes no sense, while removing the parameter from the request reduces the request size.