Do wix data hooks not run when an insert is run in a backend .jsw file?

Its difficult to say without seeing your code, but the hook should run per the documentation at these times:

  • The insert() function is called.

  • An action is performed on a dataset that inserts a new item into the collection.

  • An item is inserted using the Content Manager.

  • An item is imported into the Sandbox or Live collection.

Is your hook code located in data.js?
When you say wasn’t working, what do you mean? Was there an error? Did you have any logs in there to check?
How are you testing your code? (live, preview, functional testing)