Skip to main content

Laravelnote in How to track your site search by Laravel 2021

Step into the shoes of one of your website users for a moment.

You’ve landed on a site and you know exactly what you’re looking for. What’s the first thing you do? That’s right, you look for a search bar.

If by chance, you run an e-commerce site, nearly half of your visitors do this first, according to a Forrester report. (1) Having an optimized site search in place – complete with things like autofill and fuzzy matching – helps people find the things they’re looking for quicker.

You may have already built an amazing search experience on your site with TNTSearch and Laravel Scout. Now it’s time to make the most of it.

Introducing TNT Search Analytics

TNT Search Analytics is a browser-based reporting tool the Laravel dev community has long been missing. It’s built on top of TNT Search to provide you with answers to important questions, such as:

  • How many people search my site and what are they searching for?
  • How quickly are they getting the results back and are they relevant to their queries?
  • What keywords and phrases are being searched the most?

With Laravel Scout and TNTSearch, search queries on your website are logged in real time, as your users are typing them in.

Let's do a quick search for some airports and see how the results are presented in TNT Search Analytics. You can try this demo yourself if you want.

These insights matter. They help you understand your users' intent and gauge whether your site search performs well.

TNT Search Analytics has everything you need to fine-tune your search functionality and lead users to the right place, including:

Daily, weekly, and monthly search stats

Discover how many people use the search functionality on your site and get the total number of searches per day, week, or month as well as their average execution time.

Use this information to figure out the percentage of visitors who use the search functionality on your site.

If you've been thinking of placing the search bar higher up on your homepage where more people can see it, low usage numbers could give you the push you need to make the necessary changes.

Search trends & query expansion

Dig deeper to find out the most sought-for keywords and phrases on your site. This will give you a good idea of what products and services are popular with your users — something you can use to center your marketing efforts around.

You can also analyze the most popular searches that didn't yield any results.

Results not showing up after a search are almost certain to drive some web visitors away from your site. That's why it’ss crucial you take a closer look at them and see if you can fill in the gaps.

For example, if your users have been searching for ''German'', and can't see any flight tickets to Germany they're thinking of buying, then you're running the risk of losing sales.

Likewise, if you're in charge of a news site that's covering global politics, a blank results page a user gets after searching the same term could indicate your content is incorrectly tagged or you don't have any articles on the matter.

It's time to either fix your tagging or start producing content that meets the needs of your users.

With TNT Search Analytics, you can expand failed queries to return the results users want to see and interact with. It's as simple as editing the term to match the intended result.

Email reports

Maybe you don't feel like opening a new tab whenever you want to check your top-performing searches and opportunities for improvement.

That's fine. You can get site search insights delivered straight to your inbox by scheduling a daily, weekly, or monthly trigger.

Simply add the following cron entry to your server:

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

then run:

php artisan schedule:work

And set your desired frequency, for example:

$schedule->command('tnt-analytics:daily')->daily();

Get started

If your site is still missing a search functionality, go ahead and build one with TNTSearch. It's the best full-text search (FTS) engine for Laravel websites out there — and it's free.

Once you're ready to refine the search experience on your site, get TNT Search Analytics. A powerful search engine is only as good as the analytics behind it. 

Popular posts from this blog

Composer Security Update (CVE-2021-29472) for leravel #2021

Composer had a security vulnerability reported (CVE-2021-29472) and a new version has been released to address this. Everyone should run  composer self-update  to get v2.0.13 which includes the fix. According to their  announcment : As a precaution after updating Composer we recommend you audit your composer.lock files to ensure they only contain URLs and none which start with -- , e.g. --config and could be considered command line options. Should you find any such URL values despite our belief that this vulnerability was not exploited in the wild, please contact us immediately by email to security@packagist.org. In general we always recommend you review changes you make to your lock files to ensure no untrusted dependencies or external URLs are introduced to your application. Please note that Packagist.org is only a metadata server and package contents are downloaded from a location chosen by the package maintainers. Private Packagist will store copies of mirrored packag...

Laravel8 in Serializes Models trait | laravelnote

This article was originally posted, with additional formatting, on my personal blog at laravel serializes model Background  When dispatching an object onto the queue, behind the scenes Laravel is recursively serializing the object and all of its properties into a string representation that is then written to the queue. There it awaits a queue worker to retrieve it from the queue and unserialize it back into a PHP object (Phew!). Problem When complicated objects are serialized, their string representations can be atrociously long, taking up unnecessary resources both on the queue and application servers. Solution Because of this, Laravel offers a trait called SerializesModels which, when added to an object, finds any properties of type Model or Eloquent\Collection during serialization and replaces them with a plain-old-PHP-object (POPO) known as a ModelIdentifier. These identifier objects represent the original properties Model type and ID, or IDs in the case of an Eloquent\Collecti...

Octane Support in Laravel forge 2021 5 may

 Back in March, Taylor announced the new Laravel Octane project at Laracon Online. Since then, we've been busy working on bug fixes and enhancements to Octane, as well as adding support to Laravel Forge. Today we're pleased to announce that Octane support is available in Forge. We've written the guide below to help you get started. Please keep in mind that Octane is still in beta and should not be used in production. Prerequisites Your project must require "laravel/octane": "^0.3.2" or above. Your server must have PHP 8.0 installed. You should then follow the Octane installation instructions listed in the Octane repository. Creating an Octane Site Octane can be enabled by selecting the Laravel Octane (Beta) project type option and PHP 8.0 as the PHP version that should be used to serve your site: Laravel Octane Project Type Laravel Octane Project Type Once the project type has been selected, Forge will ask for the port that Octane should listen on. Unlik...