Commit 0b30b30f authored by Dominik Hebeler's avatar Dominik Hebeler

Piwikintegration eingebaut

parent 60ee8b1c
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use File;
use Response;
use App\Http\Requests;
use PiwikTracker;
class ImageController extends Controller
{
public function generateImage(Request $request)
{
#Piwik Code
PiwikTracker::$URL = 'http://piwik.metager3.de';
$piwikTracker = new PiwikTracker( $idSite = 1 );
// Cookies ausschalten
$piwikTracker->disableCookieSupport();
$piwikTracker->deleteCookies();
$site = $request->input('site', '/');
// Sendet Tracker request per http
$piwikTracker->doTrackPageView($site);
$path = public_path() . '/img/1px.png';
$fileType = File::type($path);
$response = Response::make( File::get($path), 200);
$response->header('Content-Type', $fileType);
return $response;
}
}
......@@ -22,6 +22,8 @@
Route::get('/', 'StartpageController@loadStartPage');
Route::get('img/piwik.png', 'ImageController@generateImage');
Route::get('impressum', function()
{
return view('impressum')
......
......@@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "6c69571109b6dd87f8d052141f0f526c",
"content-hash": "36e343030681180e2b652dc511a00c9b",
"hash": "4ef0f871df372735c70d3045d6d8e1e5",
"content-hash": "b7c1e8fa7a337e7f92bf6e4d2df47992",
"packages": [
{
"name": "classpreloader/classpreloader",
......@@ -1167,6 +1167,46 @@
],
"time": "2016-03-18 20:34:03"
},
{
"name": "piwik/piwik-php-tracker",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/piwik/piwik-php-tracker.git",
"reference": "f026613f8137c014030c96a22491ede5f5f1676b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/piwik/piwik-php-tracker/zipball/f026613f8137c014030c96a22491ede5f5f1676b",
"reference": "f026613f8137c014030c96a22491ede5f5f1676b",
"shasum": ""
},
"type": "library",
"autoload": {
"classmap": [
"."
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "The Piwik Team",
"email": "hello@piwik.org",
"homepage": "http://piwik.org/the-piwik-team/"
}
],
"description": "PHP Client for Piwik Analytics Tracking API",
"homepage": "http://piwik.org",
"keywords": [
"analytics",
"piwik",
"tracker"
],
"time": "2016-01-12 21:44:22"
},
{
"name": "psr/http-message",
"version": "1.0",
......
......@@ -34,6 +34,7 @@
</div>
</div>
</footer>
<img src="{{ action('ImageController@generateImage')}}?site={{ urlencode(url()->current()) }}" class="hidden" />
<script src="/js/jquery.js" type="text/javascript"></script>
<script src="/js/bootstrap.js" type="text/javascript"></script>
<script src="/js/masonry.js" type="text/javascript"></script>
......
......@@ -108,7 +108,7 @@
<img src="/img/luh_metager.png" alt="LUH Logo"></a></li>
</ul>
</footer>
<img src="{{ action('ImageController@generateImage')}}?site={{ urlencode(url()->current()) }}" class="hidden" />
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/js/bootstrap.js"></script>
<script type="text/javascript" src="/js/scriptStartPage.js"></script>
......@@ -125,5 +125,6 @@
</button>
In der Zeit vom 07.07.2016 bis 15.07.2016 führen wir Wartungsarbeiten durch, die das Setzen eines nicht identifizierenden Cookies für diesen Zeitraum unvermeidbar machen. Weitere Informationen finden Sie auf unserer <a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/datenschutz#cookie") }}">Datenschutz-Seite</a>.
</div>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment