This is actually not hard to do, you just need to use the plugin that jayderyu mentioned. Then it's as easy as adding the "Execute" action from that plugin to any part of your game. For instance, after a button is pressed, add the CallJS execute action and enter one of the names of the javascript functions the publisher needs, like "PUBLISHER_SUBMITSCORE()".
You don't need to do anything else.
As for the function to start the game it's a bit more technical but still easy. You can't add that function inside C2, you need to add it after you export the game by editing the index.html with a text editor. You only need to make 1 edit:
Find the line: // Start the Construct 2 project running on window load.
There you'll find the following code:
jQuery(document).ready(function ()
{ ?
?// Create new runtime using the c2canvas
?cr_createRuntime("c2canvas");
});
You need to replace all of that with this new code:
{ ?
function PUBLISHER_GAMESTART()
{
jQuery(document).ready(function ()
?// Create new runtime using the c2canvas
?cr_createRuntime("c2canvas");
});
}
On the new code, replace PUBLISHER_GAMESTART with any name you need for the function to start the game. Everything should be ready after that.