Clean Facebook Data & Calculate Daily Ad Spend


πŸ“Š Outcome: Visualized Google & Facebook Ads Cost

πŸ•‘ Estimated Time: ~30min

πŸ—’ Structure:

  1. Clean Facebook Data
  2. Combine Google and Facebook Data
  3. Visualize Data

🏷 End Result:



Clean Facebook Data

πŸŽ₯ Video Explanation:



πŸ‘ž Step by Step:


  1. Open the Model from 1.2
  2. Insert Input Node and select Facebook Ads: ads_insights
  3. Use a Fields Node to drop and Rename Columns; We would recommend renaming:
    - date_start -> date
  4. Change Field Types: date column
    1. Add Text Extraction Node to drop the information on the time
      (Value Type: INDEX, Condition: BEFORE, Value: 11)Bildschirmfoto_2021-08-15_um_22.20.22.png

    2. Add Date Parser node to convert the type of the date column from text to dateBildschirmfoto_2021-08-15_um_22.20.31.png


Combine Google and Facebook Data

πŸŽ₯ Video Explanation:



πŸ‘ž Step by Step:


  1. Use a Functions Node to create new column ('platform') and put as function: "Facebook"

    Moving over to the Google Data

  2. Disconnect the Output node from the Google Date Parser node

  3. Put a Functions Node after the Date Parser and create a new column ('platform') and put as the function: "Google"

  4. Use a "Union" Node and connect it to both date Node Chains to put the data from both input sources under each other

  5. Connect the Union Node with the output node

  6. Click on the Output Node and select the columns that you want to use in the Output

  7. Commit the Model



Visualize Data 

πŸŽ₯ Video Explanation:



πŸ‘ž Step by Step:


  1. Go to the Modeling Section and create a new dashboard 
  2. Add a widget and select the "Daily Ad spend" table as an input
  3. Drag and drop the columns into the fields:
    - Segment by: Date of date
    - Breakdown by: platform
    - Summarize by: Sum of Spend


πŸ₯³ Congrats! You finished the first module!

(Stay tuned - More modules are coming soon... πŸ˜‰)



Was this article helpful?
3 out of 3 found this helpful