Which state to deduct business expenses during consulting engagement in a different state?

I live and have a solo consulting practice in State A, where I maintain a home office and do most of my work. I have a client in neighboring State B. When I work for that client, I drive from State A to State B, spend the entire day at the client site in State B, and then return home to State A. Both states levy personal income taxes.

 

When I file my state tax returns, I will report the 1099-MISC revenue from the State B client on my State B tax return (and receive a matching credit on my State A return for the resulting taxes paid to State B). How do I handle my travel expenses to and from the client site? Do I take those expenses against the State B revenue and report the net amount to State B as income, or do I report the full State B revenue to State B as income and report the travel expenses to State A against my other revenue? Or do I have to figure out what proportion of the trip from my home office to the client site travels over State A roads vs State B roads and split the expense between the two returns proportionally somehow?

 

Clearly, my home office and other expenses belong only on the State A return, taken against my State A revenues. But what about other expenses like professional certifications, advertising, and the like that have some intangible, non-specific impact on my State B activities as well? Do I allocate them between the two states based on the proportionate revenues, or do I reckon all of those other expenses against my State A (home state) revenues?