fix loadPageSpeed metrik
This commit is contained in:
parent
1c614cc22d
commit
dae9810ec8
Binary file not shown.
Binary file not shown.
@ -81,19 +81,14 @@
|
|||||||
[{if $oD3GASettings->getValue('blD3GATrackPageLoadTime')}]
|
[{if $oD3GASettings->getValue('blD3GATrackPageLoadTime')}]
|
||||||
[{block name="d3ga_trackpageloadtime"}]
|
[{block name="d3ga_trackpageloadtime"}]
|
||||||
var perfData = window.performance.timing;
|
var perfData = window.performance.timing;
|
||||||
var pageLoadTime = perfData.domComplete - perfData.navigationStart;
|
var pageLoadTime =
|
||||||
var loadTime = "";
|
Math.round(
|
||||||
|
(
|
||||||
|
(perfData.domComplete > 0 ? perfData.domComplete : perfData.responseEnd) - perfData.navigationStart
|
||||||
|
) / 1000
|
||||||
|
);
|
||||||
|
|
||||||
if (pageLoadTime < 1000) { loadTime = "0-1 seconds"; }
|
ga('set', 'metric1', pageLoadTime);
|
||||||
else if (pageLoadTime < 2000) { loadTime = "1-2 seconds"; }
|
|
||||||
else if (pageLoadTime < 3000) { loadTime = "2-3 seconds"; }
|
|
||||||
else if (pageLoadTime < 4000) { loadTime = "3-4 seconds"; }
|
|
||||||
else if (pageLoadTime < 5000) { loadTime = "4-5 seconds"; }
|
|
||||||
else if (pageLoadTime < 6000) { loadTime = "5-6 seconds"; }
|
|
||||||
else if (pageLoadTime < 10000) { loadTime = "6-10 seconds"; }
|
|
||||||
else { loadTime = "10+ seconds"; }
|
|
||||||
|
|
||||||
ga('set', 'metric1', loadTime);
|
|
||||||
[{*ga('send', 'event', 'Page Load Time', loadTime, {'nonInteraction': true});*}]
|
[{*ga('send', 'event', 'Page Load Time', loadTime, {'nonInteraction': true});*}]
|
||||||
[{/block}]
|
[{/block}]
|
||||||
[{/if}]
|
[{/if}]
|
||||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user