eve_prerender Dynamic Prerender plugin for WordPress

A couple of years ago I wrote a guide on prerender explaining the benefits of implementing it. A simple line of code can improve website usability and conversion funnel optimization.

A technical limitation of the prerender is that for each URL it is possible to set only one condition: browsers at the date of writing manage only one pre-load – I tested by inserting 2 and with 3 conditions but only the first prerender is considered. In other words, I can pre-load a single page in the browser , hoping that the user will follow the path that I have set .

How do I set the most frequent routes?

Since it is not possible to insert preprender at will, the secret is to study the navigation paths of users for each page, and to define the most frequent passages between one page and another. To simplify this analysis, I recommend usingGoogle Tag Manager – GTM and setting all the tracking indicated in this guide , in particular in this guide I will use internal link tracking .

By tracking internal links , navigating from page “A” to page “B” of the same site, we can store two sets of important information:

  • Which are the “A” pages that most often refer a user to another internal page. In other words, the pages that contain the most clicked internal links.
  • Which are the “B” pages in which the user lands most often starting from an internal page. In other words, the most clicked internal links.

Note: The “A” pages are the pages that reduce the bounce rate on your website, study them well! In this regard, you might be interested in reading:

  • Reducing the Bounce Rate
  • Track outbound links to increase pageviews

Assuming that GTM’s tracking has been implemented correctly, you should now have an Events section in Google Analytics dedicated to internal links. The report shows the pages containing the most clicked links in the Event Action column , and the most clicked internal links in the Event Label . At this point, just export the report and make a Pivot in Excel to see the data as follows:

  • Page “A” | Page “B” | Click count

Analysis of the most clicked internal links

In this case, starting from the homepage (which is the Event Action with the highest count) I analyze the most clicked internal links and discover that it is the / services-seo / page.

Analysis of the most clicked internal links

Now I study the second page – Event Action where users click multiple internal links: excluding the anchors inside the page, I discover that the most clicked internal link leads to the Screaming Frog guide. The process continues like this until I draw up a list of steps “A” -> “B” that represents a good percentage of internal navigations.

Download the WordPress plugin

The first time I did this analysis I caught the ball and put the rules in a very basic WordPress plugin : just download it, change the conditions, upload it to your site and activate it. You can download it here but, before installing it, you need to enter your steps. The process is simple, don’t be afraid of 4 lines of PHP. Now download the file and open it with your notepad (I use Notepad ++).

In the PHP file you need to make your appropriate replacements:

First of all enter the starting page “A” as post_id : for example elseif (is_page (6999)) .

Then enter the destination URL in the echo field as destination link “B” .

Note: to find the value of post_id , open the article whose value you want to find in edit and look at the URL: the post_id is the numeric value that you find after “post =”.

Edit the plugin

The PHP code of the plugin is very simple, if you have an analytical eye it will seem clear to you even without knowing a word of PHP. In the script there are 4 conditions, each condition is composed of an “if” which represents the condition to be checked , and an “echo” which defines the prerender line to be printed on the page . In the first condition, for example, I set this rule: on the homepage enter the prerender towards / page1 /.

  • if is_home:if page “A” is the homepage, then …
  • elseif is_page (6999):if page “A” is post_id 6999, then …
  • elseif is_page (13407) or is_page (14952):if page “A” is post_id 13407 or 14952, then …
  • else:if page “A” is different from the previous three, then …

You can add as many conditions as you want by simply duplicating the second or third condition (single or multiple). The result is that for each page you will have an optimized prerender based on the browsing habits of your users . The more pages you set the prerender, the higher the browsing speed perceived by the user.

Don’t forget to also set conditions especially in the conversion funnel , such as the checkout path of an eCommerce.

To verify correct operation , refer to the Prerender guide linked at the beginning of the article.

For doubts or clarifications leave a comment. Would you like this feature on your site but you don’t know how to implement it? Contact me now.

Related posts