$("#payment-form .plan").change(update_methods);
+ function qs(key) {
+ key = key.replace(/[*+?^$.\[\]{}()|\\\/]/g, "\\$&"); // escape RegEx meta chars
+ var match = location.search.match(new RegExp("[?&]"+key+"=([^&]+)(&|$)"));
+ return match && decodeURIComponent(match[1].replace(/\+/g, " "));
+ }
+
$("#payment-form").submit(function() {
- _paq.push(['trackGoal', 12, parseFloat($("#id_amount").val())]);
+ let camp = qs('pk_campaign');
+ if (!camp && window.location.pathname !== "/towarzystwo/") {
+ camp = window.location.pathname;
+ }
+ let dims = camp ? {dimension2: camp} : {};
+ _paq.push(['trackGoal', 12, parseFloat($("#id_amount").val()), dims]);
});
});