When user clicks the article’s title, I want to open Current Article’s Article URL in a new tab so they can read it on the original site. Don’t want them to lose the tab for my app, so easy enough to use a Link element with Link destination property set to External URL.
I want to log the view event (eg increment Current Article’s Article Views count) when the user clicks the link, so I can show “most viewed articles” elsewhere in the app.
This is where the problem arises. There isn’t a way to trigger a workflow from the Link element. Nor can you create an event using “when [x] element is clicked…” logic, b/c Link elements are not eligible to select.
Anyone solved this? Using clicks on Link elements as workflow triggers?
You might be able to do something with some custom HTML or Javascript, but I don’t think there’s a way to do this using the built-in workflow system. I’d be happy to be proven wrong!
Create the workflow with a regular element (like your clickable text) and then replace that text with a link element (right-click and use “replace” option). The workflow will stay and you’ll be able to utilize the link’s new tab feature.
I feel like this is a loophole since, you’re right, the link element doesn’t technically offer an event trigger option, but it works!
Speak too loudly, and the Bubble overlords will fix this loophole! Or make it official, which would be pretty nifty. I’ve done it this way before, and confirm it does work, I was just always afraid to leave it that way as it felt like a bug.
By sending people to this custom link, I can then create a workflow after detecting whether “Get link from page URL is not empty”. I first create a log entry of this link click (so I can count link clicks later) followed by sending the user to the external URL.
thanks @philip, this is a great idea! I love that I get even more control over logging events this way. For example, there are points associated with viewing articles, I can now control those trying to “game” the system by rage-clicking the links and limit the # of view log events I record per day by user.
@potentialthings, @romanmg nice to know there’s a workaround at least for the moment. Inclined to use @philip’s solution as I gain more control over event logging by passing params. Appreciate the help!