Test matomo tracker
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Alfrasc\MatomoTracker\Facades\LaravelMatomoTracker;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Models\IkeaProducts;
|
use App\Models\IkeaProducts;
|
||||||
use Illuminate\Http\Client\Pool;
|
use Illuminate\Http\Client\Pool;
|
||||||
@@ -27,7 +28,12 @@ class ProductsCompareController extends Controller
|
|||||||
$text = $request->input("text");
|
$text = $request->input("text");
|
||||||
$country = $request->input("country");
|
$country = $request->input("country");
|
||||||
|
|
||||||
Log::channel('db')->info("{codes} {countries} {country} {online} {text} {ip} {referer}", ["codes" => $codes, "countries" => $countries, "country" => $country, "online" => $online, "text" => $text, "ip" => $request->ip(), "referer" => $request->headers->get('referer')]);
|
$vars = ["codes" => $codes, "countries" => $countries, "country" => $country, "online" => $online, "text" => $text, "ip" => $request->ip(), "referer" => $request->headers->get('referer')];
|
||||||
|
|
||||||
|
Log::channel('db')->info("{codes} {countries} {country} {online} {text} {ip} {referer}", $vars );
|
||||||
|
LaravelMatomoTracker::doTrackAction('compare', $text);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$codes = collect($codes);
|
$codes = collect($codes);
|
||||||
$countries = collect($countries);
|
$countries = collect($countries);
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
"laravel/sanctum": "^2.14.1",
|
"laravel/sanctum": "^2.14.1",
|
||||||
"laravel/tinker": "^2.7",
|
"laravel/tinker": "^2.7",
|
||||||
"masterminds/html5": "^2.8",
|
"masterminds/html5": "^2.8",
|
||||||
|
"matomo/matomo-php-tracker": "^3.2",
|
||||||
"paquettg/php-html-parser": "^2.2",
|
"paquettg/php-html-parser": "^2.2",
|
||||||
"pusher/pusher-php-server": "^7.0",
|
"pusher/pusher-php-server": "^7.0",
|
||||||
"spatie/laravel-permission": "^5.5",
|
"spatie/laravel-permission": "^5.5",
|
||||||
|
|||||||
2
composer.lock
generated
2
composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "932b0270f36b70f4585461c8c5e49167",
|
"content-hash": "38ea7f8106608bed752012bfa0ee857d",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "alfrasc/laravel-matomo-tracker",
|
"name": "alfrasc/laravel-matomo-tracker",
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ return [
|
|||||||
/**
|
/**
|
||||||
* The auth token of your user
|
* The auth token of your user
|
||||||
*/
|
*/
|
||||||
'tokenAuth' => env('MATOMO_AUTH_TOKEN', ''),
|
'tokenAuth' => env('MATOMO_AUTH_TOKEN', '3a58110f13366a6438f86a17bf6d2d4c'),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For queuing the tracking you can use custom queue names. Use 'default' if you want to run the queued items within the standard queue.
|
* For queuing the tracking you can use custom queue names. Use 'default' if you want to run the queued items within the standard queue.
|
||||||
|
|||||||
@@ -139,5 +139,6 @@
|
|||||||
"error: ziggy error: route 'products.count' is not in the route list.": "Error: Ziggy error: route 'products.count' is not in the route list.",
|
"error: ziggy error: route 'products.count' is not in the route list.": "Error: Ziggy error: route 'products.count' is not in the route list.",
|
||||||
"doc": "Doc",
|
"doc": "Doc",
|
||||||
"firefox 125": "Firefox 125",
|
"firefox 125": "Firefox 125",
|
||||||
"logs": "Logs"
|
"logs": "Logs",
|
||||||
|
"typeerror: $matomo.trackevent is not a function": "TypeError: $matomo.trackEvent is not a function"
|
||||||
}
|
}
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
"vue": "3.3.x",
|
"vue": "3.3.x",
|
||||||
"vue-google-charts": "^1.1.0",
|
"vue-google-charts": "^1.1.0",
|
||||||
"vue-json-pretty": "^2.4.0",
|
"vue-json-pretty": "^2.4.0",
|
||||||
|
"vue-matomo": "^4.2.0",
|
||||||
"vue-multiselect": "^3.0.0-beta.3",
|
"vue-multiselect": "^3.0.0-beta.3",
|
||||||
"vue3-easy-data-table": "^1.5.47",
|
"vue3-easy-data-table": "^1.5.47",
|
||||||
"vue3-multiselect-checkboxed": "^0.0.9",
|
"vue3-multiselect-checkboxed": "^0.0.9",
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ const screenHeight = ref(screen.height)
|
|||||||
const hover = ref(true);
|
const hover = ref(true);
|
||||||
const hoverImage = ref(null);
|
const hoverImage = ref(null);
|
||||||
const selectedRow = ref(null);
|
const selectedRow = ref(null);
|
||||||
|
// const $matomo = inject('$matomo');
|
||||||
|
|
||||||
const sdropdown = ref([
|
const sdropdown = ref([
|
||||||
{ text: "Description", value: "typeName" },
|
{ text: "Description", value: "typeName" },
|
||||||
@@ -407,6 +408,7 @@ const showRow = async (item) => {
|
|||||||
country: settingsStore.country.code,
|
country: settingsStore.country.code,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log('MATOMO',$matomo);
|
||||||
products.value = response.data.products;
|
products.value = response.data.products;
|
||||||
countryHash.value = response.data.countryHash;
|
countryHash.value = response.data.countryHash;
|
||||||
console.log("TEST=", response.data);
|
console.log("TEST=", response.data);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import Swal from 'sweetalert2';
|
|||||||
import { Inertia } from '@inertiajs/inertia';
|
import { Inertia } from '@inertiajs/inertia';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import * as commons from './common.js'
|
import * as commons from './common.js'
|
||||||
|
// import VueMatomo from 'vue-matomo';
|
||||||
|
|
||||||
const appName = window.document.getElementsByTagName('title')[0]?.innerText || 'Laravel';
|
const appName = window.document.getElementsByTagName('title')[0]?.innerText || 'Laravel';
|
||||||
|
|
||||||
@@ -30,13 +31,20 @@ createInertiaApp({
|
|||||||
return createApp({ render: () => h(app, props) })
|
return createApp({ render: () => h(app, props) })
|
||||||
.use(plugin)
|
.use(plugin)
|
||||||
.use(ZiggyVue, Ziggy)
|
.use(ZiggyVue, Ziggy)
|
||||||
|
// .use(VueMatomo, {
|
||||||
|
// // Configure your matomo server and site by providing
|
||||||
|
// host: 'https://matomo.soson.eu',
|
||||||
|
// siteId: 3,
|
||||||
|
// })
|
||||||
.mixin({
|
.mixin({
|
||||||
methods: {
|
methods: {
|
||||||
...commons,
|
...commons,
|
||||||
themes: () => Themes,
|
themes: () => Themes,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.mount(el);
|
// .provide('$matomo', VueMatomo)
|
||||||
|
.mount(el)
|
||||||
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
@inertiaHead
|
@inertiaHead
|
||||||
|
|
||||||
<!-- Matomo -->
|
<!-- Matomo -->
|
||||||
<script>
|
{{-- <script>
|
||||||
var _paq = window._paq = window._paq || [];
|
var _paq = window._paq = window._paq || [];
|
||||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||||
_paq.push(['trackPageView']);
|
_paq.push(['trackPageView']);
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||||
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
||||||
})();
|
})();
|
||||||
</script>
|
</script> --}}
|
||||||
<!-- End Matomo Code -->
|
<!-- End Matomo Code -->
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
Reference in New Issue
Block a user