I don't know of any possibility to retrieve the event definition key using data binding, but here is the solution I use for my custom activities:
- I added a field to the configuration dialog of the custom activity where I enter the event definition key when configuring the activity
- When the configuration is finished I construct/overwrite the arguments with the now correct data binding expressions in customActivity.js
Using this solution you don't need to adapt the config.json and host a custom activity for every journey and only add an additional input field to your configuration wizard.
Additional field in configuration wizard interface:
<input id="eventDefinitionKey" placeholder="journey entry event's event definition key" type="text" required="required" minlength="1">
Setting the inArguments on save in customActivity.js:
var eventDefinitionKey = $('#eventDefinitionKey').val();
payload['arguments'].execute.inArguments = [{
'FirstName': '{{Event.' + eventDefinitionKey + '.FirstName}}'
}];
An example can be found on my github account: