diff --git a/apps/course/templates/course/course.html b/apps/course/templates/course/course.html index db228e96..cd10eaff 100644 --- a/apps/course/templates/course/course.html +++ b/apps/course/templates/course/course.html @@ -395,4 +395,13 @@ {% block foot %} {% include "templates/blocks/popup_course_buy.html" %} + {% endblock foot %} diff --git a/project/templates/blocks/lil_store_js.html b/project/templates/blocks/lil_store_js.html index 54c9ca60..e3f9ede4 100644 --- a/project/templates/blocks/lil_store_js.html +++ b/project/templates/blocks/lil_store_js.html @@ -22,6 +22,9 @@ }, components: {}, urls: { + course: /\/course\/\d+\/, + courseBuy: /course\/\d+\/checkout/, + courseBuySuccess: "{% url 'course_payment_success' %}", courses: "{% url 'courses' %}", courseEdit: /\/course\/\d+\/edit/, courseCreate: "{% url 'course_create' %}", @@ -31,6 +34,15 @@ faq: "{% url 'faq' %}", contestEdit: /contest\/\w+\/edit/, userGalleryEdit: "{% url 'user-gallery-edit' %}", + school: "{% url 'school:school' %}", + schoolBuy: "{% url 'school-checkout' %}", + schoolBuySuccess: "{% url 'payment-success' %}", + camp: "{% url 'school:drawing-camp' %}", + campBuy: "{% url 'camp-checkout' %}", + campBuySuccess: "{% url 'camp-payment-success' %}", + giftCertificates: "{% url 'gift-certificates' %}", + giftCertificateBuy: /gift-certificate\/\d+\/checkout/, + giftCertificateBuySuccess: /payments\/gift-certificate\/\d+\/success/, }, flags: { referrer: '{{ referrer.id|default:'' }}', diff --git a/web/package.json b/web/package.json index 5101212a..61af19be 100755 --- a/web/package.json +++ b/web/package.json @@ -10,7 +10,7 @@ "devDependencies": { "autoprefixer": "^6.3.3", "babel-core": "^6.26.0", - "babel-loader": "^7.1.2", + "babel-loader": "^7.1.5", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.6.1", "babel-preset-es2015": "^6.24.1", @@ -24,13 +24,13 @@ "node-sass": "^4.12.0", "require-dir": "^0.3.0", "run-sequence": "^1.1.5", - "sass-loader": "^7.0.1", + "sass-loader": "^7.3.1", "style-loader": "^0.20.1", - "through2": "^2.0.1", + "through2": "^2.0.5", "url-loader": "^0.6.2", - "vue-loader": "^14.1.1", + "vue-loader": "^14.2.4", "vue-style-loader": "^3.1.2", - "vue-template-compiler": "^2.5.13", + "vue-template-compiler": "^2.6.10", "webpack": "^3.10.0" }, "dependencies": { @@ -38,32 +38,32 @@ "autosize-input": "^1.0.2", "axios": "^0.19.0", "babel-polyfill": "^6.26.0", - "baguettebox.js": "^1.10.0", - "bowser": "^2.1.2", - "clipboard": "^2.0.1", - "downscale": "^1.0.4", + "baguettebox.js": "^1.11.0", + "bowser": "^2.6.0", + "clipboard": "^2.0.4", + "downscale": "^1.0.6", "extract-loader": "^3.1.0", - "glob": "^7.1.2", - "history": "^4.7.2", + "glob": "^7.1.4", + "history": "^4.9.0", "ilyabirman-likely": "^2.3.0", "inputmask": "^3.3.11", "jquery": "^3.4.1", - "js-cookie": "^2.2.0", + "js-cookie": "^2.2.1", "lodash.debounce": "^4.0.8", "modal-video": "git+https://github.com/gzbender/modal-video.git", - "moment": "^2.20.1", + "moment": "^2.24.0", "owl.carousel": "^2.2.0", - "slugify": "^1.2.9", + "slugify": "^1.3.5", "smooth-scroll": "^12.1.5", - "sortablejs": "^1.7.0", - "svg-sprite-loader": "^3.7.3", - "uuid": "^3.2.1", + "sortablejs": "^1.9.0", + "svg-sprite-loader": "^3.9.2", + "uuid": "^3.3.3", "validator": "^9.2.0", - "vue": "^2.5.13", + "vue": "^2.6.10", "vue-autosize": "^1.0.2", "vue-awesome-swiper": "^3.1.3", "vue-tags-component": "^1.3.0", - "vuedraggable": "^2.16.0", + "vuedraggable": "^2.23.0", "vuejs-datepicker": "^0.9.25", "vuelidate": "^0.6.1" } diff --git a/web/src/js/modules/gtag.js b/web/src/js/modules/gtag.js new file mode 100644 index 00000000..42ae4ba1 --- /dev/null +++ b/web/src/js/modules/gtag.js @@ -0,0 +1,13 @@ +import $ from 'jquery'; + +$(document).ready(function () { + if(window.LIL_STORE.urlIs(window.LIL_STORE.urls.course)){ + const $btn = $('[data-popup=".js-popup-course-buy"]'); + $btn.click(() => { + window.gtag('event', 'begin_checkout', { + "items": [window.LIL_STORE.data.gtagProduct], + "coupon": "" + }); + }); + } +});