Improve monitoring script ingress

This commit is contained in:
R. Miles McCain 2020-04-14 17:59:51 -04:00
parent 47f6775cab
commit 902e5a8324
No known key found for this signature in database
GPG Key ID: 91CB47BDDF2671A5
2 changed files with 4 additions and 4 deletions

View File

@ -15,8 +15,8 @@ from ..tasks import ingress_request
def ingress(request, service_uuid, identifier, tracker, payload):
time = timezone.now()
client_ip, is_routable = get_client_ip(request)
location = request.META.get("HTTP_REFERER") or ""
user_agent = request.META.get("HTTP_USER_AGENT") or ""
location = request.META.get("HTTP_REFERER", "").strip()
user_agent = request.META.get("HTTP_USER_AGENT", "").strip()
ingress_request.delay(
service_uuid,

View File

@ -14,8 +14,8 @@
<p>Place the following snippet at the end of the <code>&lt;body&gt;</code> tag on any page you'd like to track.</p>
<div class="card ~neutral !high font-mono text-sm">
{% filter force_escape %}<noscript><img
src="//{{request.site.domain}}/ingress/{{object.uuid}}/pixel.gif"></noscript>
<script src="//{{request.site.domain}}/ingress/{{object.uuid}}/identifier/script.js"></script>
src="//{{request.site.domain}}{% url 'ingress:endpoint_pixel' object.uuid %}"></noscript>
<script src="//{{request.site.domain}}{% url 'ingress:endpoint_script' object.uuid %}"></script>
{% endfilter %}
</div>
<hr class="sep h-4">