Closes #3 — record successful public GET hits, show last-30-day views and top pages on the analytics report, and keep portal/admin/API paths out of the counts.
This commit is contained in:
@@ -4,6 +4,21 @@ from core.models import TimeStampedModel, UUIDPrimaryKeyModel
|
||||
from leads.models import Lead
|
||||
|
||||
|
||||
class PageView(UUIDPrimaryKeyModel, TimeStampedModel):
|
||||
"""One successful GET of a public marketing page."""
|
||||
|
||||
path = models.CharField(max_length=512, db_index=True)
|
||||
|
||||
class Meta:
|
||||
ordering = ["-created_at"]
|
||||
indexes = [
|
||||
models.Index(fields=["created_at", "path"]),
|
||||
]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.path or "/"
|
||||
|
||||
|
||||
class UTMVisit(UUIDPrimaryKeyModel, TimeStampedModel):
|
||||
correlation_id = models.CharField(max_length=64, db_index=True)
|
||||
path = models.CharField(max_length=512, blank=True)
|
||||
|
||||
Reference in New Issue
Block a user