Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Allow publishers to register an event listener using the subscriptions object #1163

Open
ed-bird opened this issue Jul 9, 2020 · 2 comments

Comments

@ed-bird
Copy link
Collaborator

ed-bird commented Jul 9, 2020

Using the existing registerEventListener or registerEventFilterer methods, publishers should be able to register their own event listener to track SwG events.

For example:

subscriptions.registerEventListener(function (event) { 
  // Send event to publisher server
});

I think exposing the entire eventManager object might be too much as that could be used to push new events instead of just registering the listener.

@martinschierle
Copy link

The linked issue seems fixed, and I just tried it one of out pubs, and it seems to work well - am I correct that we can consider this launched and document as needed on devsite? Syntax seems to be:

subscriptions.getEventManager().then(manager => {
manager.registerEventListener((e) => sendToMyAnalytics(e))
});

@martinschierle
Copy link

Although giving it a second look - the events only carry an eventType ID:

image

While pub can probably look up relevant IDs in this repo, might it be worth to give them an interface to get a speaking name/type as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants