Depending on the gear ratio, the length of your motor will vary, see dimension drawing. That's why I included versions for different reducer lengths.
Needs two M3 screws to fasten.
If you have a motor without encoder, have a look at Arnoud's nice design over at thingiverse.
Update 2022-06-21: Included FreeCAD source files.
The author hasn't provided the model origin yet.