Moin,
Ich habe eine direkte Weiterleitung auf unserer Seite. Also man kommt über einen Qr-code auf domain.de/download-app und von dort über eine php auf den jeweiligen app-store. Könnt ihr mir sagen wie ich es jetzt schaffe, dass mein Analyticskonto mitbekommt, dass diese personen auf meiner seite waren?
Die Php sieht aus wie folgt:
PHP
<?php /* Template Name: appredirect */ ?>
<html>
<head>
<!-- Global Site Tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id="></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '');
</script>
</head>
<body>
<?php
$target = 'https://domain.de'; // Startseite
if ( !empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) ) {
if ( stripos( $_SERVER[ 'HTTP_USER_AGENT' ], 'android' ) !== false ) {
$target = 'https://google.com/...'; // Android
} else if (
stripos( $_SERVER[ 'HTTP_USER_AGENT' ], 'iphone' ) !== false
|| stripos( $_SERVER[ 'HTTP_USER_AGENT' ], 'ipod' ) !== false
|| stripos( $_SERVER[ 'HTTP_USER_AGENT' ], 'ipad' ) !== false
) {
$target = 'https://apple.com/..'; // Apple
}
}
header( 'Location: ' . $target );
?>
</body>
</html>
Alles anzeigen
Momentan sehe ich da noch nichts, aber kann es sein, dass es eine weile dauert bis analytics das anzeigt? oder hab ich nen ganz anderen fehler gemacht?
Vielen Dank!