Howto include *.js files in own plugins


I’m developing a own Piwik plugin and I cant include a JS file. So far I made the hook in the myPlugin.php see as below:

function getListHooksRegistered()
	return array( 
		'AdminMenu.add' => 'addMenu',
		'AssetManager.getJsFiles' => 'getJsFiles',

function getJsFiles($notification)
	$jsFiles = &$notification->getNotificationObject();
	$jsFiles[] = "plugins/myPlugin/templates/MyPlugin.js";		

do I have to do something else, because so far, this is not working. My *.js file is on the server and has just a console.log in it.

thanks in advance, Peter

It should work OK.
However you need to disable merged assets, see:

Hi Matt,

I am also facing same problem. How to disable merged assets? Please help me on this.

Thanks, Bhagat

in config/config.ini.php


disable_merged_assets = 1