How to get visitor source/url information | Community
Skip to main content

How to get visitor source/url information

  • April 2, 2019
  • 6 replies
  • 0 views

Hello,

I'm trying to get visitor source (url, app) information using Conversations API with nodeJS - https://develop.zendesk.com/hc/en-us/articles/360001331787

 

How it may possible?

Ideally,  I would like to send this information manually in web widget parameters as "tags" or alternative. For example: 

 

<!-- Start of halykbank1548844306 Zendesk Widget script -->
<script id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key=20997b00-3db0-43c6-8fdd-8757bee4b4d1"> </script>
<script type="text/javascript">
window.zESettings = {
webWidget: {
chat: {
tags: ['Homebank']
}
}
};
</script>
<!-- End of halykbank1548844306 Zendesk Widget script -->

 

Homebank is a source I want to handle

 

Thank you

 

 

This topic has been closed for replies.

6 replies

  • April 3, 2019

For "source", we currently do support tags in our API. You can be read them from the Visitor's current_tags field here: https://graphql-docs.com/docs/Visitor/?graphqlUrl=https://chat-api.zopim.com/graphql/request

For URL, agents can also view the pages that visitor has visited through VisitorChannel's web_paths field: https://graphql-docs.com/docs/VisitorChannel/?graphqlUrl=https://chat-api.zopim.com/graphql/request

 

Let us know if these helps :)


  • Author
  • April 5, 2019

Thank you for quick response

I am not an GraphQL expert

If you could suggest the best way of adding Visitor's current_tags to the following query, I would much appreciate that:

 

const messageSubscriptionQuery = {
payload: {
query: `subscription {
message {
node {
id
content
channel {
id
}
from {
__typename
display_name
}
}
}
}`
},
type: "request",
id: REQUEST_ID.MESSAGE_SUBSCRIPTION
};


  • April 11, 2019

Hi Ануар,

Here is an example adding it to the channel field and from field:

Note that if you add it to the channel field, you will always get it for every messages (regardless it is from agent or visitor). Alternatively, the current_tags in from field will only be available for messages that sent by visitor (hence the use of Visitor inline fragment). For more information about the syntax, you can refer to https://graphql.org/learn/queries/#inline-fragments. Hope it is helpful!


  • Author
  • April 18, 2019

Thank you

We were able to get tags on sandbox account using following query. But it does not see tags when using main account. Everything else works fine 

query: `subscription {
message {
node {
id
content
channel {
id
... on VisitorChannel {
tags
visitor{
current_tags
current_platform
current_device_type
}
}
}
from {
__typename
display_name
... on Visitor {
current_tags
}
}
}
}
}`

 

Can you please take a look?

 

sandbox - http://halykbank1548844306.zendesk.com/

 

main Enterprise account - https://halykbank.zendesk.com/chat/agent


  • April 22, 2019

Hi,

 

May I know how do you set the tag? Is it using the widget API ($zopim.livechat.addTags)? From what I observed, this API is never executed and hence the tag is never set.

 

Thank you!


  • Author
  • April 22, 2019

Thank you

We resolved the problem by adding tags through triggers