Analyse Data with SQL - Marketing Attribution - CoolTShirts

Hi everyone :wave:,

Here is the link to my CoolTShirts presentation: SQL_Marketing Attribution_CoolTShirts.pptx - Google Drive

If you could please share with me your comments on my:

  1. Code/queries: Are they correct? Can they be made better?
  2. Answers/conclusions: Are they correct?

Any feedback would be greatly appreciated :hugs: :call_me_hand:

I have reviewed your presentation. The code/query is well written and you have followed the style guide. The conclusions are correct. A point of observation is since this in the SkillPath for Analyzing Date, it would add value to provide analysis even in first and last touch attributions.

Can you please have a look at my slides and provide your feedback. Thanks in advance!

Hi Harsha,

Apologies for my late reply. First, thank you for reviewing my work and I agree with your comment, I should have provided more analysis and will remember it for next time.

Second, here is my review of your work based on the matrix:
1. Report: 4

2. Query accuracy: 3

  • Q3: Add column for “utm_source”
  • Q4: Add column for “utm_source”
  • Q5: Line 33, it gives the correct results however, for better accuracy I used instead " WHERE page_name = ‘4 - user purchase’ "
  • Q6: Add column for “utm_source”
  • Q6: Line 25, remove “pv.page_name” as it is obsolete
  • Q6: Line 31, it gives the correct results however, it is quicker to replace “lt_attr.user_id” with “*”
  • Q6: The query result is incorrect for Weekly Newsletter, Retargeting Ad, and Retargeting Champaign. The “purchases” should be 153, 113, and 54, respectively. I believe the mistake lies in:
    – Delete line 33. Instead add as a new line 19 after “FROM…” as " WHERE page_name = ‘4 - purchase’ "

3. Query formatting: 3

  • Q1: Add an empty line between the 3 queries
  • Q1: Line 5, move “utm_source” to a new line
  • Q3: Line 4, change “as” to “AS”
  • Q3: Line 17, create an alias e.g. “COUNT(*) AS num_ft_attr”
  • Q4: Line 17, change “as” to “AS”
  • Q4: Line 20, move up to the end of line 19
  • Q4: Line 30, move up to the end of line 29
  • Q4: Line 32, create an alias e.g. “COUNT(*) AS num_lt_attr”
  • Q5: Line 5, change “count” to capital letters
  • Q6: Line 17, change “as” to “AS”
  • Q6: Line 20, move up to the end of line 19
  • Q6: Line 30, move up to the end of line 29
  • Q6: Line 31, change “count” to capital letters
  • Q6: Line 31, create an alias e.g. “COUNT(*) AS num_lt_attr”. It looks strange because in the query results output, the column is named “purchases” however, the alias “purchases” does not come from the code. Did you hard code the column name in the output?
  • Q6: Line 31, move “COUNT(*) AS num_lt_attr” to a new line

4. Understanding underlying concepts and terminology: 4

Hope this helps and let me know if something is not clear.

Thx // GG