Add better tracking script protocol support
This commit is contained in:
parent
c84dac6b01
commit
d88f61b281
@ -14,8 +14,8 @@
|
|||||||
<p>Place the following snippet at the end of the <code><body></code> tag on any page you'd like to track.</p>
|
<p>Place the following snippet at the end of the <code><body></code> tag on any page you'd like to track.</p>
|
||||||
<div class="card ~neutral !high font-mono text-sm">
|
<div class="card ~neutral !high font-mono text-sm">
|
||||||
{% filter force_escape %}<noscript><img
|
{% filter force_escape %}<noscript><img
|
||||||
src="//{{request.site.domain}}{% url 'ingress:endpoint_pixel' object.uuid %}"></noscript>
|
src="{{script_protocol}}{{request.site.domain}}{% url 'ingress:endpoint_pixel' object.uuid %}"></noscript>
|
||||||
<script src="//{{request.site.domain}}{% url 'ingress:endpoint_script' object.uuid %}"></script>
|
<script src="{{script_protocol}}{{request.site.domain}}{% url 'ingress:endpoint_script' object.uuid %}"></script>
|
||||||
{% endfilter %}
|
{% endfilter %}
|
||||||
</div>
|
</div>
|
||||||
<hr class="sep h-4">
|
<hr class="sep h-4">
|
||||||
|
@ -4,6 +4,7 @@ from django.core.cache import cache
|
|||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.shortcuts import get_object_or_404, reverse
|
from django.shortcuts import get_object_or_404, reverse
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
from django.conf import settings
|
||||||
from django.views.generic import (
|
from django.views.generic import (
|
||||||
CreateView,
|
CreateView,
|
||||||
DeleteView,
|
DeleteView,
|
||||||
@ -85,6 +86,11 @@ class ServiceUpdateView(
|
|||||||
)
|
)
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
|
def get_context_data(self, *args, **kwargs):
|
||||||
|
data = super().get_context_data(*args, **kwargs)
|
||||||
|
data["script_protocol"] = "https://" if settings.SCRIPT_USE_HTTPS else "http://"
|
||||||
|
return data
|
||||||
|
|
||||||
|
|
||||||
class ServiceDeleteView(
|
class ServiceDeleteView(
|
||||||
LoginRequiredMixin, PermissionRequiredMixin, SuccessMessageMixin, DeleteView
|
LoginRequiredMixin, PermissionRequiredMixin, SuccessMessageMixin, DeleteView
|
||||||
|
Loading…
Reference in New Issue
Block a user