Step 3: QA & Debugging

Once you finish setting up your visitor analytics, you’ll want to QA your work and confirm you’re seeing them getting passed in with your searches and clicks. If you notice that your visitor ID and visitor ID method aren’t getting logged with your analytics then, you should also follow these steps to debug.

Below are steps to how you can check to see if your searches and clicks are getting passed the visitor ID and visitor ID method you expect.

If visitor ID and visitor ID method is not getting passed this means there is some issue upstream in your implementation or you simply had no visitor ID or visitor ID method available for a user when they ran their search / click.

You can rule out the latter by ensuring you meet the conditions for the visitor object to be created. For example, if it is created when a logged in user’s email is passed to local storage, you should log in and check this data is in local storage.

Searches

You can validate that searches are accepting visitor ID and visitor ID method as expected by examining the requests made by your search experience as follows:

  1. Right click anywhere on your page and click Inspect.
  2. Depending on your browser and your settings a panel will appear on either the side or bottom of your page.
  3. Click the Network tab displayed across the top of the panel.
  4. Type “live” into the filter bar.
  5. Run a search.
    • If you ran a search before you’ve done steps 1 - 4, you’ll need to run another search.
  6. You will see two requests appear that start with autocomplete? and query? respectively.
  7. Click the request that starts with query?
  8. You should now see tabs for the following options presented:
    • Headers
    • Payload
    • Preview
    • Response
    • Initiator
    • Timing
    • Cookies
  9. Click Payload.
  10. If the visitor ID and visitor ID method were passed correctly you should see a parameter for each under the Query String Parameters section with your visitorId and visitorIdMethod.

api request for visitor in searches

Clicks

You can validate that clicks are accepting visitor ID and visitor ID method as expected by examining the requests made by your search experience as follows:

  1. Right click anywhere on your page and click Inspect.
  2. Depending on your browser and your settings a panel will appear on either the side or bottom of your page.
  3. Click the Network tab displayed across the top of the panel.
  4. Type “analytics” into the filter bar.
  5. Run a search.
    • If you ran a search before you’ve done steps 1 - 4, you’ll need to run another search.
  6. Click on an Entity CTA in the search results.
  7. For each entity you’ve clicked, you will see a request pop up in the Network tab labeled with the business ID of your Yext account.
  8. Click on a request.
  9. You should now see tabs for the following options presented:
    • Headers
    • Payload
    • Preview
    • Response
    • Initiator
    • Timing
    • Cookies
  10. Click Payload.
  11. If the visitor ID and visitor ID method were passed correctly you should see a property under the Request Payload section called visitor which contains two properties id and idMethod.

api request for visitor in clicks