charlie4282, I suppose it should be included in template preview only because code from preview is usually stolen.
charlie4282 saidDo it nice. Add a simple notice on top on all sites that use the source code from demo. I did it once and it worked. I sold ~15 copies in a week where showing the notice on their site. Some of them sent me a message with apologies for using a illegal copy, they had no idea the template is available for sale and is not free.
While I am opposed to any form of piracy – creating hidden JS which allows you to inject code or any form of discreet tracking, is a huge breach of genuine buyers privacy and I would imagine against policy for files on sale here.
@Svecc, @rayoflightt, nothing special. You can place a function somewhere in a big js file and minimize that file. Here is an example