I'm exploring the option of adding a search bar within a SFMC email.
I've used the following script (that I can't seem to render properly here, but I'll give it a shot):
form action="https:URL[?search=" search-string-parameter-here="]"
input aria-label="Search Website" aria-owns="awesomplete_list_2" autocomplete="off" class="input input-text header-search-input" id="searchText" name="SearchText" placeholder="keywords like:'Fridge'" role="combobox" style="background-color: #ffff; border: 1; border-color: #7d96a4; font-size: 16px; line-height: 22px; padding-left: 4px; color: #2d2d2d;" type="text" value=""
button aria-label="Submit Search" class="button button-search header-search-button" id="SubmitSearch" name="SubmitSearch" style="background-color: #eeeeee; border: 1; font-size: 16px; line-height: 22px; padding-left: 4px; margin: 5px; color: #2d2d2d;" type="submit" value="submit">Search
But I have two questions:
- Issue 1: When someone enters a keyword and hits 'Search' CTA, it leads them to the Search landing page instead of retrieving the Search results. Any recommendations on how to go about it?
- Question: Is there a way to add some code to this HTML, so we can potentially analyse what's being searched? Maybe add some query to record searched keywords in a data extension?
Thanks for the help! :)