Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Result_url and Result_title variables in Events tracking not returning variables
This topic contains 5 replies, has 2 voices, and was last updated by Ernest Marcinko 1 year, 11 months ago.
- AuthorPosts
- April 18, 2021 at 5:21 pm #32797
Hi,
I have activated several of the options in the Google Analytics events tracking successfully. However, I am having problems with Results click event tracking.I have used {result_url} and {result_title} for Event action and Event Label respectively. In the Analytics admin, Event Action literally returns {result_url}. Event Label returns “not set”. Am I missing something? The variables {search_name} and {phrase} are working just fine.
I bought another license that has up-to-date support: 049e146f-2f54-4634-abae-3c16029755da
URL in question and admin credentials provided.
Thanks!!
April 19, 2021 at 9:01 am #32806Hi,
Thank you for the details, it helps us a lot!
The problem is the customization on the results. The plugin detects the title by looking for an anchor link with the “asp_res_url” class. That is however missing in your case, it was probably removed via the customization.
Best,
Make sure to add the “asp_res_url” class to the “entry-title-link” anchor, and it should start working again: https://i.imgur.com/iiRJXDI.png
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
April 21, 2021 at 1:34 am #32858Thanks that was very helpful. Currently I changed other anchor links as well with the same piece of code (outside of AJAX pro search, like my blog list).
Would having asp_res_url on these anchors include them in the AJAX analytics? As far as I can tell, asp_res_url doesn’t add any styling.
Just wondering if I need to update some of my customization to specifically add asp_res_url to only the ASP results, so clicks on blog page for example don’t show as ASP results.
Thanks!
April 21, 2021 at 7:42 am #32860You are welcome!
That only affects the live results list nothing else, you don’t need to add them anywhere else. You can if you want to, but it will not affect the analytics, as it is restricted to elements within that container.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 2, 2021 at 9:06 pm #33039Hi Ernest,
The change you mentioned worked for {result_title}. I am now seeing the result title come through on Google Analytics Event Label. The Event Action however is still showing “{result_url}”. Thoughts? Here is the search in question: https://employersforumindiana.org/resources/Thanks!
May 3, 2021 at 12:36 pm #33054I don’t know unfortunately. The event handler seems to be attached, the class is there, the code on the plugin side is fine as well. Everything seems to be in place. The same exact code is parsing the label, so even that is all right, the element is found as well.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.