Here’s a how-to and trade-offs of 2 plugins for shortening URLs
Google Shorten URL
Pros: Dead-simple set up; Free if <1Mil conversions/day; analytics dashboard
Con: If you’re not dedicated server, you cannot lock down the API via an IP (as the Bubble IP is not constant) or via your domain (as Bubble does a server redirect)
- Add Google URL Shortener Plugin in Bubble
- Enable API via google console (https://console.developers.google.com/) -> Library
- Get your API key in credentials tab. Also, add IP or domain restriction if you’re on a dedicated Bubble plan. If you’re not on a dedicated plan, you cannot lock down the API.
- Add your API key in the Bubble plugin “API Key”
- Then use “GET data from External API” in Bubble to convert URLs
- Add Rebrand.ly Plugin in Bubble
- Create a Rebrand.ly Account
- Get an API key (https://developers.rebrandly.com/docs/api-custom-url-shortener)
- Enter the API key in the Bubble Plugin.
( I put the key in each box, and it works. Not sure why there are multiple… )
- Head back to Rebrand.ly to rebrand the URL shortener. Add your domain in Rebrand.ly (https://rebrandly.com/newdomain). You’ll need access to your DNS set up to add the CNAME for rebrandly.
- You’ll also need your domain_id. The easiest way to get this is to go to https://developers.rebrandly.com/docs/domains-list-endpoint. Find the “/v1/domains” section. Then, click try it out. Enter your API key from step 3. This will return your domain_id.
- Now, head back to bubble to use “GET data from External API” in Bubble to convert a URL.
The final products look like so:
- I’ve converted the raw “Eventbrite URL” using google and rebrandly. My brand is “Meetaway” so you can see the URL that my users will see.
Within the editor, I selected “GET data from External API” and set up the following: