Skip to main content

Top of funnel for apptype

SELECT to_char(date(a.created_at),'YYYY-MM') as year_month, COUNT(), COUNT() FILTER(WHERE a.saved = true) As num_saved, COUNT() FILTER(WHERE a.content IS NOT NULL) AS num_content, COUNT() FILTER(WHERE a.last_viewed_at > a.created_at + INTERVAL '3 days') as num_active_after_3_days, COUNT() FILTER(WHERE a.last_viewed_url IS NOT NULL) AS num_url_exists, COUNT() FILTER(WHERE a.external_id_type = 'wix') AS num_wix, COUNT() FILTER(WHERE a.external_id_type = 'wix' AND a.saved = true) AS num_wix_saved, COUNT() FILTER(WHERE a.external_id_type = 'wix' AND a.content IS NOT NULL) AS num_wix_content, COUNT() FILTER(WHERE a.external_id_type = 'wix' AND a.last_viewed_at > a.created_at + INTERVAL '3 days') AS num_wix_active_after_3_days, COUNT() FILTER(WHERE a.external_id_type = 'wix' AND a.last_viewed_url IS NOT NULL) AS num_wix_url_exists, COUNT() FILTER(WHERE a.external_id_type = 'shopify') AS num_shopify, COUNT() FILTER(WHERE a.external_id_type = 'shopify' AND a.saved = true) AS num_shopify_saved, COUNT() FILTER(WHERE a.external_id_type = 'shopify' AND a.content IS NOT NULL) AS num_shopify_content, COUNT() FILTER(WHERE a.external_id_type = 'shopify' AND a.last_viewed_at > a.created_at + INTERVAL '3 days') AS num_shopify_active_after_3_days, COUNT() FILTER(WHERE a.external_id_type = 'shopify' AND a.last_viewed_url IS NOT NULL) AS num_shopify_url_exists, COUNT() FILTER(WHERE a.external_id_type IN('weebly-integrated','weebly')) AS num_weebly, COUNT() FILTER(WHERE a.external_id_type IN('weebly-integrated','weebly') AND a.saved = true) AS num_weebly_saved, COUNT() FILTER(WHERE a.external_id_type IN('weebly-integrated','weebly') AND a.content IS NOT NULL) AS num_weebly_content, COUNT() FILTER(WHERE a.external_id_type IN('weebly-integrated','weebly') AND a.last_viewed_at > a.created_at + INTERVAL '3 days') AS num_weebly_active_after_3_days, COUNT() FILTER(WHERE a.external_id_type IN('weebly-integrated','weebly') AND a.last_viewed_url IS NOT NULL) AS num_weebly_url_exists, COUNT() FILTER(WHERE a.external_id_type = 'bigcommerce') AS num_bigcommerce, COUNT() FILTER(WHERE a.external_id_type = 'bigcommerce' AND a.saved = true) AS num_bigcommerce_saved, COUNT() FILTER(WHERE a.external_id_type = 'bigcommerce' AND a.content IS NOT NULL) AS num_bigcommerce_content, COUNT() FILTER(WHERE a.external_id_type = 'bigcommerce' AND a.last_viewed_at > a.created_at + INTERVAL '3 days') AS num_bigcommerce_active_after_3_days, COUNT() FILTER(WHERE a.external_id_type = 'bigcommerce' AND a.last_viewed_url IS NOT NULL) AS num_bigcommerce_url_exists, COUNT() FILTER(WHERE a.external_id_type = 'html') AS num_html, COUNT() FILTER(WHERE a.external_id_type = 'html' AND a.saved = true) AS num_html_saved, COUNT() FILTER(WHERE a.external_id_type = 'html' AND a.content IS NOT NULL) AS num_html_content, COUNT() FILTER(WHERE a.external_id_type = 'html' AND a.last_viewed_at > a.created_at + INTERVAL '3 days') AS num_html_active_after_3_days, COUNT() FILTER(WHERE a.external_id_type = 'html' AND a.last_viewed_url IS NOT NULL) AS num_html_url_exists, COUNT() FILTER(WHERE a.external_id_type = 'squarespace') AS num_squarespace, COUNT() FILTER(WHERE a.external_id_type = 'squarespace' AND a.saved = true) AS num_squarespace_saved, COUNT() FILTER(WHERE a.external_id_type = 'squarespace' AND a.content IS NOT NULL) AS num_squarespace_content, COUNT() FILTER(WHERE a.external_id_type = 'squarespace' AND a.last_viewed_at > a.created_at + INTERVAL '3 days') AS num_squarespace_active_after_3_days, COUNT() FILTER(WHERE a.external_id_type = 'squarespace' AND a.last_viewed_url IS NOT NULL) AS num_squarespace_url_exists, COUNT() FILTER(WHERE a.external_id_type IN('jimdo-integrated','jimdo')) AS num_jimdo, COUNT() FILTER(WHERE a.external_id_type IN('jimdo-integrated','jimdo') AND a.saved = true) AS num_jimdo_saved, COUNT() FILTER(WHERE a.external_id_type IN('jimdo-integrated','jimdo') AND a.content IS NOT NULL) AS num_jimdo_content, COUNT() FILTER(WHERE a.external_id_type IN('jimdo-integrated','jimdo') AND a.last_viewed_at > a.created_at + INTERVAL '3 days') AS num_jimdo_active_after_3_days, COUNT() FILTER(WHERE a.external_id_type IN('jimdo-integrated','jimdo') AND a.last_viewed_url IS NOT NULL) AS num_jimdo_url_exists FROM apps a JOIN app_type_mapper atm ON atm.alias = a.app_type WHERE a.created_at > '2016-11-01' AND atm.main = 'popup' GROUP BY year_month ORDER BY year_month;