How to get visitor source/url information

7 Comments

  • Yu-Hsuan Chao

    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 :)

    0
  • 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
    };

    0
  • Sutrisno Suryajaya

    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!

    1
  • 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

    0
  • Sutrisno Suryajaya

    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!

    1
  • Thank you

    We resolved the problem by adding tags through triggers

    0
  • Hello,

    May I ask you one more question on this issue.

    I'm trying to get/update chat information using Chats API, but ids there are different than Conversations API ids. 

     

    Is there a way to get a single chat ID, so I can use it for both Conversations API and Chat API?

     

     

    0

Please sign in to leave a comment.

Powered by Zendesk