How open external site (in new tab) and also trigger a separate workflow?

Hi.

Is it possible to have Link element (which I understand is the only way to open a URL in a new browser tab) and also to trigger a separate workflow (e.g. increment a link click counter stat in my database)?

I have several stores listed in a series of separate row groups, each with a icon and a link element (see screenshot). The link element allows me to force the url to open in a new tab (as required) but then I have no way to trigger a workflow to do the link counter number increment in my database (also needed). I tried to attach the workflow to do the incrementing to the group, thinking that maybe the link, when clicked (and it being inside the group) would trigger both, but it does not.

Screenshot 2023-01-12 at 13.55.54

If you’re not bothered about not using a link element, then you can just use window.open("https://www.myurl.com"); in your workflow

Yeah, I found the ‘Toolbox’ plugin straight after posting that query. I should have delved deeper into the forum posts before asking. I have it working now. Thanks @adamhholmes

1 Like

the JS method is excellent, but won’t be as helpful (if at all) for SEO purposes. If you want to optimize for SEO, you’ll want to use this hack.

If you do want to use a link element (and there are plenty of reasons why you might), then you can try the method linked to by @mac2, which works (but is one of those quirky ‘features/hacks’ not officially supported by Bubble, so I’d be careful about relying on it in case they remove it at some point)…

Alternatively, perhaps a more reliable way is just to use the toolbox plugin to add an event listener to the link, then trigger the workflow when it’s clicked…

e.g. Link Workflow

1 Like

Hi Adam. I have copied the linked workflow for listening for an event but can’t get it to work. My link element is within a popup so wondering if this is the issue?

Desperately trying to get some workflow actions in place whilst still enabling external URL links to be opened in a new tab!

What do you mean exactly by ‘can’t get it to work’?

What isn’t working? the link? The workflow? What exactly?

Hi Adam. I’ll do a Loom video over the weekend.

1 Like

Is this achievable if the url is a datatype like a link to the company’s Website