Add Dynamic Pricing to Tracking Code for Goal Pages
As you probably know by now, Goal Pages are used by VisiOlo to track opt-in goals and sales goals for you. When a goal is defined as a sales goal, you must assign a value to that goal. For most products, this is fine. But what if you have a product with variable pricing? What if you are running a dime sale where the price increases by 10 cents with every sale?
In this case, you can add a price variable to your VisiOlo tracking code to send the actual price to VisiOlo — and override the default price you set up when you configured your goal.
Here’s how it works.
First, here is the standard VisiOlo tracking code, without the dynamic price variable added.
<script type=”text/javascript” src=”http://www.visiolo.com/visiolo.js.php”></script>
<script type=”text/javascript”>
_vspg=360;
trackPage();
</script>
Now, we are going to add the variable for price which is ‘_vssale’
<script type=”text/javascript” src=”http://www.visiolo.com/visiolo.js.php”></script> <script type=”text/javascript”> _vspg=360; _vssale=1.99; trackPage(); </script>In this case, the sale price is hard coded into the tracking code as ‘1.99′ — but that doesn’t help much, if you want to capture dynamic pricing. For this, you will need a variable. Every payment system uses different variables but, in most cases, price data can be populated with the use of a PHP variable. Check the documentation for your specific payment system to get the exact variable. I use the Rapid Action Profits (RAP) system, so the variable I would use is <?=$sys_item_price?>.
<script type=”text/javascript” src=”http://www.visiolo.com/visiolo.js.php”></script> <script type=”text/javascript”> _vspg=360; _vssale=<?=$sys_item_price?>; trackPage(); </script>
