Chatway Chatway
  • Home
  • Product
  • Pricing
  • Built For
  • Resources
    • Help Center
    • Blog
    • Integrations
    • Social Media Buttons
    • Glossary
  • What’s New
  • Sign In →
Sign In Sign Up for Free Free Sign Up

How to add or remove custom data to Chatway using a JavaScript function?

  • Help Center >
  • For developers >
  • How to add or remove custom data to Chatway using a JavaScript function?

In this guide we’ll show you how to add or remove custom data to Chatway using a JavaScript function.

Using this JavaScript function, you can add or remove any custom data, based on criteria that are specific to your business, such as track customers who placed an order, number of purchased items and so on. You can even use this function to filter and create customer segments.

But first: what’s custom data and what can I do with it?

Custom data tracks data about your customers — like the plan someone is on (free or paid), their purchase status or the number of purchased items.

Here are a few examples:

$chatway.updateChatwayCustomData('purchased_items', '2');

This function can be used to update the customer’s purchased items. By running this in your client’s browser console, you will update their purchase items to the one in the example given above, hence “2”.

$chatway.updateChatwayCustomData('order', 'Completed');

This function can also be used to update your customer’s order status. By running this in your client’s browser console, you will update their order status to the example given above.

$chatway.updateChatwayCustomData('plan', 'Free');

Last but definitely not least, this function can also be used to update your customer’s plan. By running this in your client’s browser console, you will update their plan to the the example given above.

The options are endless and depend entirely on your goals and objectives.

In order to remove any user data using JavaScript, you can use the following JavaScript function:

$chatway.removeChatwayCustomData('Plan');

Click here to learn more about how to update a customer’s email and name, and don’t forget to check our entire Chatway knowledgebase to make the most out of it.

Plans That Fit Every Stage of Your Growth

Start free and upgrade as your needs expand. Whether you’re working solo, leading a team, or scaling big, we’ve got a plan built for you.

Sign Up for Free

No Credit Card Required

Chatway essential features
Capterra Capterra 2 Grid Leader Grid Leader High performancer 1 High performancer 2 High performancer 3 High performancer 4 High performancer 5 GetApp Customer Support
chatway footer logo

Improve live chat communication and unlock customer satisfaction with Chatway

app store logo play store logo
5 stars reviews
1,000+ Five-Star Reviews on iOS & android app stores

Company

  • About Us
  • Privacy Policy
  • GDPR
  • Terms of Service
  • Pricing

Resources

  • Contact Us
  • Integrations
  • Built For
  • Help Center
  • Comparison Page

© 2026 Chatway. All rights reserved.

GDPR icon
Accessibility Adjustments

Powered byOneTap

How long do you want to hide the toolbar?
Hide Toolbar Duration
Select your accessibility profile
Vision Impaired Mode
Enhances website's visuals
Seizure Safe Profile
Clear flashes & reduces color
ADHD Friendly Mode
Focused browsing, distraction-free
Blindness Mode
Reduces distractions, improves focus
Epilepsy Safe Mode
Dims colors and stops blinking
Content Modules
Font Size

Default

Line Height

Default

Color Modules
Orientation Modules