Now some of you might be thinking that it might be easy to just take your variables one by one and put the below in:
s.propXX = foobar.toLowerCase();
This works only when you have a small implementation and arent adding, removing, tweaking variables. However, if you are doing this, you need something more scalable. Enter the lowercase plugin:
for(var a=1;a<=100;a++)s[“prop”+a]&&(s[“prop”+a].toLowerCase().replace(/^d=/,”D=”)),s[“eVar”+a]&&(s[“eVar”+a]=s[“eVar”+a].toLowerCase().replace(/^d=/,”D=”)),a<=5&&s[“hier”+a]&&(s[“hier”+a]=s[“hier”+a].toLowerCase().replace(/^d=/,”D=”));for(var b=[“products”,”pageName”,”channel”,”campaign”],a=0;a<b.length;a++)s[b[a]]&&(s[b[a]=s[b[a]].toLowerCase().replace(/^d=/,”D=”));
This plugin will take your props, eVars, hierarchy, pageName, channel and campaign variables and force them to lowercase without you having to do anything. If you have more than 100 eVars, I would suggest updating the a<=100 with whatever your number is so that you cover all of your bases.