I’m attempting to build what is basically a mini ifft.com or zapier clone within my app. This is where you set workflows that are triggered by events the user selects.
Here’s an example image of what a workflow could look like:
an example workflow could be: When an identified user visits the page with the id of 2, send them an email containing x.
I figure there’s two obvious ways to make the initial triggers that the user picks work:
create the url query based on the rules set by the user. So in the example above, the query would be something like site id, user id, page id - the code would just wrap this in an api request to piwik. The problem with this is, I’d have to set up some kind of watcher that constantly pings the endpoint looking for changes. That doesn’t seem very efficient.
figure out if there’s a way to customize the piwik event tracker, or create a custom one, to also alert the predefined workflow triggers that are possible in the app. This way they’re triggered every time something actually happens vs watching for changes.
My questions are:
- Is this possible?
- am I thinking about this the right way?
- are these two options the only ones available to me or are there better ways?
Any help is greatly appreciated.