fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix
[wolnelektury.git]
/
src
/
club
/
static
/
club
/
form.js
diff --git
a/src/club/static/club/form.js
b/src/club/static/club/form.js
index
f590fdf
..
a32a589
100644
(file)
--- a/
src/club/static/club/form.js
+++ b/
src/club/static/club/form.js
@@
-18,7
+18,18
@@
$(function() {
$("#payment-form .plan").change(update_methods);
$("#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() {
$("#payment-form").submit(function() {
- _paq.push(['trackGoal', 12, parseFloat($("#id_amount").val())]);
+ let camp = qs('pk_campaign');
+ if (!camp && window.location.pathname !== "/pomagam/") {
+ camp = window.location.pathname;
+ }
+ let dims = camp ? {dimension1: camp} : {};
+ _paq.push(['trackGoal', 12, parseFloat($("#id_amount").val()), dims]);
});
});
});
});