Bubble User Types - Temporary User & Shopping Cart functionality

Hi all,

I’m using bubble to build a fashion e-commerce website (which will have some app-like features hence not going down shopify / webflow route)

I’m currently working on the shopping cart workflows / logic + how that works with User data. I’ve got it working fine (touch wood!) if you’re logged in as a registered user - you can add and edit items in your bag.

What I’m struggling with at the moment is the logic for temporary users / users without an account - obviously it’s important to let unregistered people visit the website, browse, build a cart and check out.

The problem I’m having is that bubble seems to recognise it’s an unregistered user and allows the user to build cart / add / edit items etc as normal, but if go onto the website on another device to test how it works if there were 2 or more unregistered users, you can see all items added to the cart by all other unregistered users. Obviously this is a problem as you only want to buy things you’ve added to cart - not things that every other unregistered user has added too!

I might be missing something simple as I’m quite new to bubble - or perhaps a functionality that I haven’t enabled / disabled

Grateful for any pointers in the right direction :pray:

Thanks in advance!

What you can do to solve this is grab their IP address and store it in the data type that you’re using for a shopping cart. That way, you’ll be able to add a constraint to only show the shopping cart data type where IP address = current users IP address.

Tal
nocodify.com

2 Likes

Hi Tal,

Thank you for the suggestion - I’ve just implemented it using the IP address API and it seems to work fine for users who will be adding to basket from the same internet connection.

What are your thoughts on the robustness of this approach? I’m just wondering because temporary users would presumably lose their baskets if their IP address changes (if, for example, they are adding to basket on their commute using cellular data and wanted to finish off their purchase when they got home - their basket would be “wiped” if they went onto the site while connected to their home wifi - something that happens automatically for most of us)

While this is suboptimal from a conversion rate perspective when it comes to e-commerce, I recognise that at least it’s something that works, so thank you again for the suggestion.

That said, do you know whether it’s possible to access data held on the “Temporary User” type within bubble? I can’t see it in the Data tab of the editor but if it was somehow possible to filter shopping cart contents based on the session cookie data / identification data held within the temporary user type, I would imagine we could have a slightly more robust solution based on the browser as opposed to the internet connection? (I appreciate that temp user data is only stored for 3 days so this approach might have it’s own limitations, but I’m just keen to know whether it’s even an option to filter by temporary users / if each new browser session creates a new temporary user etc)

Thanks again, and P.S. - I’ve signed onto the Pro subscription on nocodify.com :slight_smile:

The problem with this approach is that we can’t use it from a GDPR point of view, as the IP address is part of the users’ personal data (if I’m correct)…

@Christophe_HK you’re right and GDPR is front-of-mind for me given I’m building this in the UK which is (as it stands) part of the EU, but I think it’s more of a secondary issue because if you have a privacy policy which outlines that your IP address data is part of the set of personal data being collected (and if the user gives consent) then it should be fine - you can add in a condition to only build the basket if a user has consented to the cookie banner (although this again is suboptimal UX).

Using IP address data means a user can continue shopping across browser types (chrome, safari, ios, etc) - but could still confuse things if multiple people were building a basket on the same connection, as might be the case with people using public Wifi or perhaps even just multiple members of the same household creating their own baskets - arguably a bigger UX issue than the cookie banner one mentioned above.

Using the temporary user type feels like a way to potentially overcome these IP address related issues, but I’m not sure how exactly to make it happen. @Nocodify - any wisdom on this topic would be much appreciated!

1 Like

you could check this https://snipcart.com/ and let us know if it works for you ? (i’m not related to them, but they market themselves as a cart as a service feature)

To enable e-commerce on Planty, you’ll need to sign up for Snipcart. Testing is forever free, no credit card required.

Cookie drop using the cookie plug-in.

Store a data type called temp-cart

Inside temp cart have a list of items
Cookie id dropped

On load check for a cookie if it’s there read and load cart from temp-cart datapoint for that visitor.

1 Like

Wow, sounds good! Could you please elaborate a bit more or provide any pointer on doc or tutorial, if it does not mind?

Below I listed 2 plugins that will get you where you want, just setup the DB, id recommend having a workflow schedule that deletes the “temp-cart” 30 days after creation so that your dB isn’t filled with just visitor data.

Plugins-
Browser cookies
Cookie handler

1 Like

Cool, many thanks for this @chris.williamson1996 :+1:t2: