You're not the only one that struggles with this. Pricing can be tricky for any industry really, but in digital marketing especially so because many still don't understand the value in it. When you can sell the value, then you can sell the price.
When it comes to setting a price for anything you can look at it one of two ways, you are either selling value or you are selling your time. When you sell value you have to be at a price that the buyer agrees on the cost of the value being received. If you're selling your time, then you need to determine how much you need for that time and hope the buyer agrees that's what it's worth.
With that, you can provide a quote or you can estimate a total cost based on the number of hours you think the job will take.
The downside to a quote is that there is often scope creep, that is the client requesting things that you never really intended to be part of the project, or them expecting a certain result and suggesting you have to do whatever it takes to get that result. This is especially important in web marketing because because there is always something more to do to.
Many people shy away from hourly work because they don't want to be "nickel and dimed" on every little thing and for the project to end up costing much more than they anticipated.
I have found a mixture of the two to work. Provide an estimate based on a certain number of hours per month. Outline what that estimate includes but be flexible if you need to do things that were never included in that estimate. Just make sure the client knows that you stop at whatever hours you agree too each month.
Any solution will have issues. You just need to find the one that works best for you and your clients.