Marketing attribution codeacademy code vs my code

This is from code academy. I modify a little bit to get more detail data from source and category

And this is what I made on my own using initial code that shown at the start of project