добавил вызов gtag через window.onload

remotes/origin/ga-ecommerce-gleb
Gleb Mikhaylov 6 years ago
parent 7792cb23e1
commit 4649719d06
  1. 28
      apps/course/templates/course/course.html

@ -395,7 +395,7 @@
{% block foot %}
{% include "templates/blocks/popup_course_buy.html" %}
<script type="text/javascript" src="{% static 'course.js' %}"></script>
<script defer>
<script>
console.log('{{ course.id }}');
console.log('{{ course.title }}');
@ -403,17 +403,19 @@
console.log('{{ course.category.title }}');
console.log('{{ course.price }}');
gtag('event', 'view_item', {
"items": [
{
"id": "{{ course.id }}",
"name": "{{ course.title }}",
"list_name": "Search Results",
"brand": "Lil.School {{ course.author.get_full_name }}",
"category": "{{ course.category.title }}",
"price": "{{ course.price }}"
}
]
});
window.onload = function () {
gtag('event', 'view_item', {
"items": [
{
"id": "{{ course.id }}",
"name": "{{ course.title }}",
"list_name": "Search Results",
"brand": "Lil.School {{ course.author.get_full_name }}",
"category": "{{ course.category.title }}",
"price": "{{ course.price }}"
}
]
})
};
</script>
{% endblock foot %}

Loading…
Cancel
Save