The Phillipian · Digital

How to put the scripts on phillipian.net

This page is for the webmaster, not for section editors. It is done once. The only files that go on phillipian.net are put-on-the-website/halfway.js and put-on-the-website/slot-clicks.js. Halfway means a reader scrolled to the middle of a story. A slot is the spot on the front page the click came from. Nothing here is installed yet.

  1. Add the Plausible snippet for phillipian.net in the theme header, before </head>. A pageview is the open.

    <script defer data-domain="phillipian.net" src="https://plausible.io/js/script.js"></script>
  2. In Plausible, add two custom-event goals named halfway and slot_click. The property names are path and slot. The names have to match exactly, including capitalization.

  3. Upload put-on-the-website/halfway.js and put-on-the-website/slot-clicks.js into wp-content/themes/phillipian2019/js/.

  4. In the theme footer, before </body>, load those two files from the theme. The Plausible tag is already in the header, so it loads first.

    <script src="<?php echo esc_url( get_template_directory_uri() ); ?>/js/halfway.js"></script>
    <script src="<?php echo esc_url( get_template_directory_uri() ); ?>/js/slot-clicks.js"></script>
  5. Do not upload guides/, make-the-monday-note/, demo/, or index.html. Those explain the note or write the five lines. They are not the live site.

To check: open one article and scroll past the middle, then click one story on the front. In Plausible, look for the halfway goal and the slot_click goal. A goal shows nothing until it has been created and the event has fired once after that.

Back to the Monday note