настроил сохранение объекта перед отправкой в га

remotes/origin/ga-ecommerce-gleb
Gleb Mikhaylov 7 years ago
parent 4649719d06
commit 9d084bedf9
  1. 17
      apps/course/templates/course/course.html

@ -397,14 +397,7 @@
<script type="text/javascript" src="{% static 'course.js' %}"></script> <script type="text/javascript" src="{% static 'course.js' %}"></script>
<script> <script>
console.log('{{ course.id }}'); let payload = {
console.log('{{ course.title }}');
console.log('{{ course.author.get_full_name }}');
console.log('{{ course.category.title }}');
console.log('{{ course.price }}');
window.onload = function () {
gtag('event', 'view_item', {
"items": [ "items": [
{ {
"id": "{{ course.id }}", "id": "{{ course.id }}",
@ -415,7 +408,13 @@
"price": "{{ course.price }}" "price": "{{ course.price }}"
} }
] ]
}) }
console.log(payload)
window.onload = function () {
console.log('{{ is_owner }}')
console.log('{{ course.price }}')
gtag('event', 'view_item', payload)
}; };
</script> </script>
{% endblock foot %} {% endblock foot %}

Loading…
Cancel
Save