If I was you I would avoid aftermarket Maf's, they are of doubtful quality, been down that road myself on my Z3, cheap ebay one didn't work, ended up getting a puka BMW one solved the issue straight away. Did try cleaning the old one with Maf cleaner but all that did was kill it completly. Always go for Bosch or Seimens which are oem brands. Other reputable brands are out there VDO has a good name as do NGK and Hella, buy cheap pay twice with the lesser known makes.
Oem parts link here https://www.realoem.com/bmw/enUS/part?id=BT53-USA-06-2004-E85-BMW-Z4_30i&mg=13&sg=15&diagId=13_0995&q=13627566983
Diagram here https://www.realoem.com/bmw/enUS/showparts?id=BT53-USA-06-2004-E85-BMW-Z4_30i&diagId=13_0995
The VDO one you are looking at cross references with the BMW Part number 13627566983
Hope that assists with your choice.