The mirror You bought is for A3s year 2017 or newer (8V platform, facelift), so it's not gonna work simply plug & play.
For mirrors which fit Your 8p prefacelift without any modifications catalogue needs to be checked. You can do that here:
interior/exterior mirror Audi A3/S3/Sportb./Lim./qu (A3) 2007 year Audi EUROPA 857040 spare parts
audi.7zap.com
But even 8p facelift doesn't come with option for frameless mirror, only on newer cars (2015+) this was an option or standard fit.
If you want to fit this mirror with working dimming function I doubt that it's doable with OEM mirror, You may need to go aftermarket, with those mirrors on ebay/Amazon with built in smart functions (traffic recorder), maybe some of those have working dimming on all cars regardless of make.
Audi A4 B9 3.0 TDi quattro 200 kw