sql [Chuck] Mutlitouch广告归属

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql [Chuck] Mutlitouch广告归属相关的知识,希望对你有一定的参考价值。

select u.id 
	, u.created_at
	, u.utm_source
	, u.utm_medium
	, u.utm_campaign 
	, ads.utm_source
	, ads.utm_medium
	, ads.utm_campaign
	, ads.created_at
	, case when 
		u.utm_source = ads.utm_source
		and u.utm_medium = ads.utm_medium
		and u.utm_campaign = ads.utm_campaign
	then 'Yes'
	else 'No'
	end as lead_to_signup
	, case when activities.id is null then 'No' else 'Yes' end as onboarded
from users as u
left join ad_clicks as ads
	on ads.lead_id = u.id
	and ads.created_at <= u.created_at
	and datediff('days', ads.created_at, u.created_at) <= 90
left join (select id, candidate_id from activities where type = 'CandidateCompletedOnboarding') as activities on activities.candidate_id = u.id
where type = 'Candidate'
	and u.utm_source <> 'organic'
	and u.created_at >= '2018-08-01'
	and u.utm_medium is not null 
	and u.utm_medium not in ('blog', 'social')

以上是关于sql [Chuck] Mutlitouch广告归属的主要内容,如果未能解决你的问题,请参考以下文章

css chuck burke的css

gossip girl chuck爸爸加入的那个神秘组织

下一个数字广告模式是什么样?

SQL Server 或 C# - 将相似的记录归为一组

sql 恢复广告服务器原始SQL

sql查询根据与用户的接近度来投放广告