Skip to content

Instantly share code, notes, and snippets.

View wnstn's full-sized avatar

Winston Hearn wnstn

View GitHub Profile
@wnstn
wnstn / ad-preview-test.html
Last active April 22, 2020 22:51 — forked from techsassy/ad-preview-test.html
Let's render ads
<html>
<head>
</head>
<body>
<script type="text/javascript">
window.hymnalAdConfig = {
id: 'f609c3cf-0a54-4d7f-a4ba-e8f3a7b96572',
slug: '_test_client_cannes_demo_storybook_f609c3cf-0a54-4d7f-a4ba-e8f3a7b96572',
adName: "Cannes Demo Storybook",
type: 'Athena Template',
  • A metric starts its journey being added on the frontend, in Hymnal, as an impression tracker (in the tracker sidepanel). You can add as many trackers as you want per ad.
  • Separately, a clickthrough url is added, and notably, there is only one of these per ad.
    • In the refactor, we'll need to update how clickthrough urls are handled, since currently they're handled by metrics_instrumentation, but we'll be refactoring HymnalAd to be the one responsible for keeping track of an ad's clickthrough url.
    • We'll also need to update the rake task I wrote to migrate the current clickthrough_urls over to HymnalAds, from MetricsInstrumentation
  • From there, the tracker form is submitted, and for every tracker that was added, a new tracker object is created/saved in the db (after a check to make sure the url entered is a valid url)