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.
-
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>
-
In Plausible, add two custom-event goals named
halfwayandslot_click. The property names arepathandslot. The names have to match exactly, including capitalization. -
Upload
put-on-the-website/halfway.jsandput-on-the-website/slot-clicks.jsintowp-content/themes/phillipian2019/js/. -
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>
-
Do not upload
guides/,make-the-monday-note/,demo/, orindex.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.