rankmath / seo-by-rank-math

Rank Math is a revolutionary WordPress SEO Plugin that combines the features of many SEO tools and lets you multiply your traffic in the easiest way possible :bulb: :chart_with_upwards_trend: →
https://rankmath.com
107 stars 52 forks source link

Use a static file when self-hosting GA #112

Open DahmaniAdame opened 2 years ago

DahmaniAdame commented 2 years ago

Describe the bug When self-hosting GA using the Pro version, GA is delivered using a query string:

https://domain.ext/?local_ga_js=e8ab1fdb027a3f6e62c1505e74e1b35a

Since it requires PHP to be served, the performance will depend on the availability of PHP workers and server resources to process the request.

In some cases, it can reach levels that will make self-hosting GA counterproductive.

Example:

image

Where it took 21s to load it.

It defies the purpose of the feature (speeding up the site by hosting external resources) and tracking as the visitor might have already left without the visit being recorded because of the delay.

It might be best to self-host GA on static files rather than using a query string to call them.

To Reproduce Steps to reproduce the behavior: N/A

Expected behavior Self-hosting GA shouldn't have any overhead on the server and should be faster than using GA's CDN.

Screenshots Attached to the description.

Desktop (please complete the following information): All.

Smartphone (please complete the following information): All.

Additional context Curious to know why RankMath is using the query string to self-host GA!