Skip to content

Commit

Permalink
Merge pull request #853 from readthedocs/ad-name-utm
Browse files Browse the repository at this point in the history
Add more explicit substitions to ad replacement
  • Loading branch information
davidfischer committed Mar 25, 2024
2 parents ffdb86e + 35fda72 commit 78a53b4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion adserver/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -981,11 +981,18 @@ def get_response(self, request, advertisement, publisher):
template = string.Template(advertisement.link)

publisher_slug = "unknown"
publisher_name = "unknown"
if publisher:
publisher_slug = publisher.slug
publisher_name = publisher.name

url = template.safe_substitute(
publisher=publisher_slug, advertisement=advertisement.slug
publisher=publisher_slug,
publisher_slug=publisher_slug,
publisher_name=publisher_name,
advertisement=advertisement.slug,
advertisement_slug=advertisement.slug,
advertisement_name=advertisement.name,
)

# Append a query string param ?ea-publisher=${publisher}
Expand Down

0 comments on commit 78a53b4

Please sign in to comment.