Tracking Breaking When Using Search Bar In Email | Community
Skip to main content
Level 2
September 17, 2020
Solved

Tracking Breaking When Using Search Bar In Email

  • September 17, 2020
  • 3 replies
  • 2321 views

Hello.

 

We are looking to start using search bars in the headers of our emails so a customer can type in their local town and on click, it takes them through to the website of the closest site to them, see below.

 

 

However, we're having an issue with the tracking breaking - if tracking is disabled for this link it works perfectly but if tracking is kept on the link it does not work and a 'requested URL cannot be found' error message is displayed.

 

The below script is used in the HTML for the search bar to pull in what the customer inputs but it appears the GA tracking doesn't like it when applied and breaks. To note, the 'abcd' in the below is just for illustrative purposes.

 

<form action="https://www.abcd.co.uk/abcd/" method="get" name="search_form" id="search_form">

 

Any ideas on how I can get this functionality to work but with the tracking enabled?

 

Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Manoj_Kumar

Hello @lcharlwood 

 

If the tracking is enabled for the form action URL then it won't work because the action URL will be replaced with the adobe tracking URL and that tracking URL does not support form submission with extra parameters and even if you manage to support the extra search parameter then the tracking URL will not forward your search query to https://www.abcd.co.uk/abcd/

 

You will have to disable the tracking for this URL to make this work.

 

Thanks

3 replies

Jonathon_wodnicki
Community Advisor
Community Advisor
September 21, 2020

Hi,

 

This works fine for me. Are you applying GA with click formula?

 

Thanks,

-Jon

Level 2
September 21, 2020

Hello @jonathon_wodnicki 

 

I believe we are applying GA with a click formula, see below.

 

<%@ include option='mabTracking_ClickFormula' %><%
var channel = '';
switch(Number(message.delivery.messageType)){
case 0: channel='email'; break;
case 1: channel='sms'; break;
case 41: channel='app'; break;
case 42: channel='app'; break;
default: channel='other';}
%>&utm_source=hermes&utm_medium=<%= channel %>&utm_content=<%= encodeURIComponent(message.segmentName) %>&utm_campaign=<%= encodeURIComponent(message.delivery.operation.label) %>

 

When clicking on the magnifying glass in the search bar I'm getting the below error ('london' being what I input in the search bar field).

 

Requested URL '/r/?id=h400a64f8%2C33273dfb%2C2a8715b4&amp;search=london&amp;searchbtn.x=23&amp;searchbtn.y=19' cannot be found

 

Any ideas?

 

Many thanks.

Manoj_Kumar
Community Advisor
Manoj_KumarCommunity AdvisorAccepted solution
Community Advisor
September 21, 2020

Hello @lcharlwood 

 

If the tracking is enabled for the form action URL then it won't work because the action URL will be replaced with the adobe tracking URL and that tracking URL does not support form submission with extra parameters and even if you manage to support the extra search parameter then the tracking URL will not forward your search query to https://www.abcd.co.uk/abcd/

 

You will have to disable the tracking for this URL to make this work.

 

Thanks

Manoj  | https://themartech.pro
Level 2
September 21, 2020
That's a shame but many thanks for clarifying.
Sukrity_Wadhwa
Community Manager
Community Manager
October 21, 2020

Hi @lcharlwood,

Were you able to resolve this query with any of the given solutions? Let us know if you need more help.

Thanks!

Sukrity Wadhwa