How to set up configuration in Answer querySource


I have an Answers search bar on location pages and contact page. I want to be able to distinguish where users are coming from when arriving to the Answers results page. The querySource parameter will speak to the Analytics section of the Yext platform and allow us to filter by integration source.

I am redirecting from search bar to results page so I set up "initializeManually": true in config/global_config.json and theme/answers-hitchhiker-theme/global_config.json answer repo

this is where I init Answers

function initAnswers() {lb}
apiKey: ‘XXXXXXXX’,
experienceKey: ‘XXXXXXXXXX’,
experienceVersion: ‘PRODUCTION’,
locale: ‘en’,
businessId: ‘XXXXXX’,
querySource: ‘LOCATION_PAGE’,
onReady: function () {lb}
ANSWERS.addComponent(‘SearchBar’, {lb}
container: ‘.js-answers-form’,
redirectUrl: ‘XXXXXXX’,
placeholderText: ‘’,
submitIcon: ‘magnifying_glass’

but the search bar fail to function. I am able to make the search and redirect. However, nothing shows up in the result page, before I set up "initializeManually": true,. I am able to make the query


After ensuring that "initializeManually" is set to true, you’ll have to set the query source and manually initialize the experience on the search results page. Here is an example of that compared to the normal JS Snippet integration:

Basic JS Snippet for Search Results Page:

<div id="answers-container"></div>
<script src="REPLACE_ME_PRODUCTION_URL/iframe.js"></script>

JS Snippet with Manual Initialization and Setting of Query Source

<div id="answers-container"></div>
<script src="REPLACE_ME_PRODUCTION_URL/iframe.js"></script>

    window.addEventListener('DOMContentLoaded', (event) => {
        AnswersExperienceFrame.runtimeConfig.set('querySource', 'SOURCE_NAME');