Support » Plugin: Ajax Search Lite » Integration problems with Analitycs
Integration problems with Analitycs
-
Hello.
Some time ago I decided to install your plugin on my test site (stage9.atutrabajo.org), which, when I finish redesigning, will replace my current site (atutrabajo.org).
So far, so good with your tool. Thanks.
However, among so many things that I am doing, I installed Google Analitycs and, taking into account that your plugin has the possibility of integrating with said tool, I have proceeded to do the following…
1) As “Google analytics integration method”, I activated the option;
Track as pageview (legacy)
2) As “Google Analytics Pageview String”, I have;
?ajax_search={asl_term}
3) And in my Google Analitycs/View Settings/Query Parameter, I copied and pasted;
ajax_search
What can be seen in your instructions;
https://documentation.ajaxsearchpro.com/analytics-integration/site-search-tracking
However, and despite the fact that, in said instructions, they mention that…
…”After a couple of hours, the new search phrases should start showing up in the site’s search report”…
I have already been configured in the above way for many hours, and yet there is still NO result. As you can see in the following screenshot;
https://ibb.co/ry7fMjY
So I ask you…
What am I doing wrong and/or am I missing?
I await your comments.
From already thank you very much.
Greetings.The page I need help with: [log in to see the link]
-
Hi,
Your site does not use the official google analytics tracking code, but a ga-lite version of it. Unfortuantely that code uses a different function name alias as the google analytics, so the plugin can not recognize it.
If you add the google analytics tracking code, it will start working.Best,
Ernest M.Hello. Thanks for answering.
Yes. I figured something like that could be it.
In any case, I’m telling you why we graduates in administration act the way we do, heh.
There is something we call “cost-benefit”. That is…
If it adds value, okay. Otherwise, what it does is add cost (unless they prove otherwise, heh).
The matter is +/- like this:
1) On my site, the “official” Analitycs code occupies a lot of space and, to top it off, it is seen by the different measurement tools, from Google itself!, as a file that blocks the rendering of the site and, consequently, , adds a few milliseconds to the load of each page.
In exchange for this, the activity reports on your Analitycs platform are “somewhat” more complete (It’s not a big deal either, eh:)
2) The lite version, on the other hand, not only does NOT block the site from loading, but on my Analitycs platform, I receive EXACTLY the data I need. That is…
How many visits did I have – Where did they come from – What did they see – Etc.
Finally, the “result” of the cost-benefit analysis…
3) What is the use of having a more “complete” version of Analitycs if this will add more seconds to the load of my site and, consequently, the visitor will go to a site with the same information but WHICH CHARGES FASTER?
Conclusion (And this – I hope – is an opportunity for improvement for you.)…
Couldn’t you add “something” to your plugin code so that the Analitycs integration tool can be used even with its Lite version installed?
As we say around here… “I leave them itching”.
One way or another, again, thanks for replying and for the excellent plugin you have created.
Greetings.
PS: Me, meanwhile…
– I will deactivate the integration because, as things are, it will only add cost and not value, heh.
– I will add again in my Analitycs, the parameter s because, if you look (well), when someone writes anything in the search engine and, if they don’t want to wait for the results, if they click, the site returns the original WordPress results.
– I will wait for you to tell me (someday) if you are going to implement what I suggest, to test again the integration between your tool and my Analitycs.
Thanks, again.Hi,
I’m not sure if we can integrate with this, but you can try a small code snippet to declare the
galite
variable toga
as alternative. In that case the search will “think” that the original analytics is integrated, and may work.Try adding this code to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.
add_action('wp_footer', 'asl_add_ga_scope', 999999); function asl_add_ga_scope() { ?> <script> window.ga = window.galite; </script> <?php }
Best,
Ernest M.Hello. Thanks for answering. Having said that…
I waited until now to answer you because, as you say in your article;
…”After a couple of hours, the new search phrases should start showing up in the site’s search report”…
Frankly, I have to say, I had some hope this would work, but it DOES NOT work.
Just in case, I’ll give you my current situation:
1) I have already implemented in my function.php the code you sent me. Namely…
add_action(‘wp_footer’, ‘asl_add_ga_scope’, 999999);
function asl_add_ga_scope() {
?>
<script>
window.ga = window.galite;
</script>
2) In fact, if you look at my source code, you will see that it is ALREADY embedded in it, as you can see in the following screenshot;
https://ibb.co/K5TdFq4
3) In my Ajax Search Lite/Analitycs Integration Panel, I have the option: Tracking as pageview (legacy) enabled as you indicate in your article.
4) Following the same article, as Google analitycs pageview string, I used ?ajax_search={asl_term} Ie EXACTLY what you suggest in the article.
Note: Points 3) and 4) can be verified in the following screenshot;
https://ibb.co/BPP69SF
Lastly, in my Anlitycs/View Settings/Site Search Tracking/Enable, I added the indicated parameter (ajax_search) next to the standard parameter(s).
As you can see in this screenshot;
https://ibb.co/QdYNp5h
And despite seeing all the instructions followed, as we say here “to the letter”… What were the “results”? Well…
5) I am NOT having ANY results. As you can see in this screenshot;
https://ibb.co/6BgbqQF
Any other idea?
I await your comments.
From already thank you very much.
Greetings.
PS: Just in case, I leave everything as described above. That is, with the code in the function.php and the aforementioned parameters.
Let’s see if, in this way, you have any other suggestions to give me.Try to check the live traffic window as well, when doing some searches – just to make sure it does not work: http://i.imgur.com/s7BXiPV.png
Hello. No. However, let me show you the following:
1) When I search in your browser (as you can see in the following screenshot);
https://ibb.co/NC2t95t
Note: As I’m assuming you’ve noticed, my site talks about “stuff” related to job hunting. For example, the resume, heh!
2) In the same capture, you will see that EVERYTHING related to the resume appears as a result.
3) If I click on any of those results, neither the search nor said operation does NOT appear ANYWHERE in my Analitycs.
However, if instead of clicking on any of the Ajax Search Lite results, I hit enter (without waiting for the ASL results), and the system takes me to the “normal” results of WordPress itself.
That is to say to this; https://ibb.co/j3CpKVB
So if, in Analitycs, the following appears;
https://ibb.co/MCsJzRc
In other words, as you can see, said link has the “famous” /?s=
In other words…
– The “normal” results of WordPress, are seen in my Analitycs
– The ones from Ajax Search Lite, no 🙁
Any other idea?
I await your comments.
From already thank you very much.
Greetings.Unfortunately I don’t know then, the “galite” function probably does not work this way. It was worth trying the snippet I recommended, but I guess there is a good reason the function name is different.
If you decide to switch to the original google analitics code, it should very likely start working without any issues.Bueh. by telling me…
…”If you decide to switch to the original Google Analytics code, it is very likely that it will start working without problems”…
It means you’re NOT sooo sure, heh.
One way or another, I tell you that I ALREADY tried!
Although, strictly speaking, what I did, as soon as your 1st came to me. The answer, related to this, was to change the GALite code to the “normal” GA code. But frankly, I tried it after a while and did NOT wait for “after a couple of hours” as you mention in your article.
I tried it after about an hour and, since it didn’t work, I left everything as it was, because what IS for sure is what I mentioned in this thread and that is…
…”The “normal” GA code blocks the loading of the page and slows it down”…
And, what I also commented on that…
…”What sense does it make that I can measure well if, when the visitor wants to see one of my pages or posts, it takes a long time to load”…
Anyway.
If at any time you have any “integral” solution for this, I would like to be among the 1st. to find out
If not it does not matter.
In the meantime, I am going to unlink your plugin from my Analitycs because, although the integration between both tools does NOT work, what I am sure of is that NOTHING is free!
In other words, surely, even if it does NOT work, the “communication” between both tools generates some kind of “delay” on my page.
For now that’s all.
Anyway, thanks (for the plugin and for your time).
Greetings.Please mind, that I am trying to help you with this, but you want to integrate with a 3rd party analytics code. I understand it is better to use instead of the original google analytics integration method. However the script uses a completely different variable scope, and there is no guarantee I can deal with it, by suggesting code snippets unfortunately.
If I just take a peak at your site error console, there are at least two major fatal errors on there. One of them is actually right after the “galite” pagetracking code: https://i.imgur.com/Dfz5CxS.png
They are probably not related to this issue, but better fix them, as those errors will cause issues with subsequent script execution.Best,
Ernest M.Hello (again, heh:). I have to apologize to you because, after sending you my previous comment, I proceeded (as I mentioned) to;
1) Unlink Ajax Search Lite from Google Analitycs
2) Remove from Analitycs the ajax-search parameter
However.
When I went to my Analitycs (to remove the aforementioned parameter), I found this;
https://ibb.co/8rdkFD2
In other words, as you can see, your recommendations YES. They worked!
What happened is that these results were only seen the next day (and NOT in a couple of hours, as you say in your article, heh:)
Having said that, it seems that searches are reflected like any other event, but NOT immediately (ie in the “live traffic window”, as you mentioned in a previous thread).
So if – apparently – your plugin + the script you sent me… THEY WORK!
As for the “error” you mention, I THINK it has to do with the fact that the script that loads GALite is async
That is…
<script async src=”/wp-content/uploads/external/gal.js”></script>
And at the same time, my caching plugin (W3TC) was combining it and… adding “defer” to it! 🙂
Anyway.
I just added the file in question (the one that runs GALite on my site) to the W3TC minified (and combined) “exceptions” list, but it’s “taking” a long time to finish “cleaning” it of all the source code. .
Which leads me to “suspect” that, despite the fact that, as you say, said error appears immediately after loading GALite, apparently it has NOT to do with said script! (But with someone else) (*)
Anyway, I already tried everything again (after excepting the js file mentioned above) and apparently it works ok (That is, the code loads, the “stuff” is seen in my Analitycs, it does NOT block me from loading the site , etc.).
But, as I mentioned, in the source code, you still see the “combination” of that file (external/gal.js) as async and – at the same time – defer, heh.
Okay. I have already reintegrated your tool with my Google Analitycs as I had previously described.
I’m going to keep trying to do test searches in your search engine and tomorrow I’ll tell you the results.
For now that’s all.
Thank you very much and, again, a thousand apologies.
Greetings.
PS: (*) Update:
1) Indeed, the only code that looks like that is the Facebook pixel!
<!– Facebook Pixel Code –>
<script>async defer crossorigin=”anonymous”
‘/wp-content/uploads/external/fb.js’;
fbq(‘init’, ‘xxxxxxxxxxxxxxxxxx’);
fbq(‘track’, ‘PageView’);
</script>
Therefore, I removed the GALite one from the exceptions, and added this one.
2) Anyway, in my source code, the “error” you mention still appears because, strictly speaking, if you look closely, it is part of the “construction” of the Facebook pixel insertion function.
This is…”<script>async defer crossorigin=”anonymous”
But, as you surely know, this code is the one that “offers” Facebook itself, to insert its pixel.
3) So, I leave it as it is and remove the script file for said pixel from the W3TC minify / merge exclusions.
In any case, I still don’t know very well what I’m installing said pixel for, because I just “informed” that they NO LONGER have Analitycs!
Anyway, as it does NOT bother me (it does not block the loading of the site) for now I leave it.
Later I will see if I can hire a FB Marketing specialist (Community Manager) and see if he finds any use for it. Or, I will proceed directly to delete it.
Okay. For now that’s all. I’ll keep doing search tests (with and without sense for my site) to see what results my Analitycs registers.
I’ll tell you tomorrow.Hello. As “promised is debt”, a thousand apologies for not having contacted me before, heh.
Anyway. Having said that…
– On the one hand, I wanted to congratulate you because, as I had already told you, the searches on the site, plus the code you sent me (to “match” ga=galite) are working, as you can see in the following screenshot , https://ibb.co/ZBrSkGp
– On the other hand, ask you if there is any way to include in these reports, the searches that do NOT include information related to the pages or articles that I already have.
I’ll explain…
In the tests I did, I put words in the search engine that I know have nothing to do with my site. For example: candy, heh!
Why? Well, precisely because I would be interested in knowing what my visitors are looking for and what I still don’t have on my site.
Obviously, I am NOT going to dedicate myself to selling candy, heh. But I would have liked the word candy to appear in the report.
If you can’t, it doesn’t matter. We leave everything as it is and, we assume that, in one way or another, we are collaborating with the visitor, by making the visit faster. Something that, on the other hand, I myself appreciate when I visit other sites.
In other words, let’s settle that the matter is resolved and we close the case.
But, if possible, I would like to know how, so that someday (if a word has many searches), I could start focusing my next articles around that word.
Back. If you can’t, no problem. I had a hard time configuring everything as it is.
And, as I told you before, the cost of a change should be less than its benefit, heh.
One way or another, thanks for the plugin, for your input, and for your patience.
See you.
- The topic ‘Integration problems with Analitycs’ is closed to new replies.