# Visitor Identification not Working

**URL:** <https://community.hubspot.com/t/visitor-identification-not-working/85234>\
**Category:** APIs & Integrations\
**Tags:** professional\
**Created:** [July 13, 2023, 4:01am UTC](https://community.hubspot.com/t/visitor-identification-not-working/85234 "2023-07-13T04:01:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LManansala2](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@LManansala2](https://community.hubspot.com/u/LManansala2)\
**Post date:** [July 13, 2023, 4:01am UTC](https://community.hubspot.com/t/visitor-identification-not-working/85234/1 "2023-07-13T04:01:15Z")

</div>

How should I integrate the Visitor Identification with Nuxt JS (vue2)?  
**i created a store that initializes the hsConversations**

setHubspotAvailability({ commit }) {

window.hsConversationsSettings = {

loadImmediately: false,

inlineEmbedSelector: “#hubspot-modal”,

disableAttachment: false,

};

if (window.HubSpotConversations) {

commit(“SET\_HUBSPOT\_CHAT\_AVAILABILITY”, true);

window.HubSpotConversations.widget.load();

window.HubSpotConversations.widget.open();

} else {

window.hsConversationsOnReady = [

() =\> {

commit(“SET\_HUBSPOT\_CHAT\_AVAILABILITY”, true);

window.HubSpotConversations.widget.load();

window.HubSpotConversations.widget.open();

},

];

}

},

_i can easily get the token and email for the hsConversationSettings object to set i just dont know where should it be placed to make it work._

**where should i place the setting of the _hsConversationSettings_ object with email and token?**

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [July 17, 2023, 9:06am UTC](https://community.hubspot.com/t/visitor-identification-not-working/85234/2 "2023-07-17T09:06:58Z")

</div>

Hello @LManansala2  
The hsConversationSettings object should be placed in the store/modules/hubspot/index.js file. Here is an example of how to do it.

```lia-code-sample
import { defineStore } from 'vuex';
import { hsConversationsSettings } from 'hubspot-conversations';

export default defineStore({
 state: {
 hubspotChatAvailability: false,
 },
 mutations: {
 SET_HUBSPOT_CHAT_AVAILABILITY(state, availability) {
 state.hubspotChatAvailability = availability;
 },
 },
 actions: {
 setHubspotAvailability({ commit }) {
 const { token, email } = getHubspotCredentials();
 window.hsConversationsSettings = {
 token,
 email,
 loadImmediately: false,
 inlineEmbedSelector: '#hubspot-modal',
 disableAttachment: false,
 };
 commit('SET_HUBSPOT_CHAT_AVAILABILITY', true);
 },
 },
});

```

First importing the hsConversationSettings object from the hubspot-conversations library. Then, we are defining a store object that has a state property with a hubspotChatAvailability property. This property will be used to store whether or not the HubSpot chat widget is available.

Next, we are defining a mutation called SET\_HUBSPOT\_CHAT\_AVAILABILITY. This mutation will be used to update the hubspotChatAvailability property in the state object.

Finally, we are defining an action called setHubspotAvailability. This action will be used to set the hsConversationSettings object. The hsConversationSettings object contains the token and email that are needed to identify the visitor.

Once you have added this code to your store, you can then call the setHubspotAvailability action to initialize the HubSpot chat widget. For example, you could call the setHubspotAvailability action in the created hook of your main component.

Here is an example of how to call the setHubspotAvailability action in the created hook

```lia-code-sample
import { mapGetters } from 'vuex';

export default {
 name: 'MyComponent',
 created() {
 this.$store.dispatch('setHubspotAvailability');
 },
 ...
};

```

Once you have called the setHubspotAvailability action, the HubSpot chat widget should be initialized and should be available to visitors.
