Add conf file in /etc/network/interfaces.d/ (I just unimaginatively called my conf file usb) which enables USB as a network device and sets a static ip Example config:.
Add modules-load=dwc2,g_ether after rootwait in boot/cmdline.txt.
(Unclear if dr_mode=peripheral is necessary, but in my permutations of configs, this was added and it works for me)
Add dtoverlay=dwc2,dr_mode=peripheral to last line of `/boot/config.txt'.
Can confirm the following makes a dietpi rpi Zero 2 W a USB gadget with a working data connection: