Solved

Can we add user to list using javascript object

  • 17 February 2024
  • 3 replies
  • 85 views

Badge +1

I have gone through the Javascript object but not getting much information about it. I am trying to add user to list using javascript object. Is it possible or should I use API?

icon

Best answer by KeviSunshine 19 February 2024, 13:10

View original

3 replies

Userlevel 4
Badge +7

Hi @tarunsoni2705,

Do you mean you’re trying to import via a JSON object?

To add a user to a list, you can import a CSV file, manually add users, or use the API to send your JSON in bulk.

Depending on what your use case is, it sounds like converting your JSON to CSV or using the API would be best.

 

Cheers,

Kevin.

Badge +1

Hello Kevin,

 

I am not importing any CSV. I have create account form in frontend and have a field where customer has to select an option “Subscribe to list”. 

My main query is can we use Klaviyo JavaScript object in frontend to add a new user to specific list?

 

Here is the link of Klaviyo JavaScript Object.

https://developers.klaviyo.com/en/v1-2/docs/introduction-to-the-klaviyo-object

Userlevel 4
Badge +7

H @tarunsoni2705,

Oh! I understand! You’re asking whether there’s a function provided by the Klaviyo object that allows you to subscribe someone to a list. The answer is no: you cannot subscribe someone to a list using the Klaviyo object.

 

You can create profiles in Klaviyo using the `identify` method and track events using the `track` method, but you’ll need to use a custom API call to subscribe profiles to lists.

 

Best,

Kevn.

Reply