Skip to content

Instantly share code, notes, and snippets.

View brunomertins's full-sized avatar

Bruno Mertins brunomertins

View GitHub Profile
WITH
-- Subquery to define static and/or dynamic start and end date for the whole query
period AS (
SELECT
'20200220' AS start_date,
FORMAT_DATE('%Y%m%d',DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)) AS end_date)
SELECT
-- Event count per user (metric | the number of times an individual event (change event_name 'page_view' to event that needs to be counted) was triggered divided by amount of users)
COUNT(DISTINCT
CASE
WITH
-- Subquery to define static and/or dynamic start and end date for the whole query
period AS (
SELECT
'20200220' AS start_date,
FORMAT_DATE('%Y%m%d',DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)) AS end_date),
-- Subquery to prepare and calculate page view data
pages AS (
SELECT
user_pseudo_id,
<?php
//* Do NOT include the opening php tag
//* Enqueue sticky menu script
add_action( 'wp_enqueue_scripts', 'custom_enqueue_script' );
function custom_enqueue_script() {
wp_enqueue_script( 'sticky-menu', get_stylesheet_directory_uri() . '/js/sticky-menu.js', array( 'jquery' ), '', true );
}
//* Reposition the secondary navigation menu
<table>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Email</th>
<th scope="col">Dept, Title</th>
<th scope="col">Phone</th>
</tr>
</thead>
<tbody>