New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best way to track app usage? #297

Open
zecman opened this Issue Jan 9, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@zecman

zecman commented Jan 9, 2018

Hi OWA users!

I would like to know if I use the best method to track the usage of a tiny app I coded...

I use the PHP tracker together with a PHP downloader and parameter handling code to record actions.

Example:

  1. User uses feature WOW of my app (closed beta)
  2. The app triggers sth. like https://web.site/dwl.php?file=tick&act1=AppXY&act2=UserXY&act3=FeatureXYused
  3. This downloads a small dummy file ("tick") and the action is tracked 1x in OWA.
  4. Deletion of "tick"

Everything works this way, but maybe there is an easier way?

@zecman

This comment has been minimized.

Show comment
Hide comment
@zecman

zecman Jan 16, 2018

Found a smarter way and will answer this by myself. :-)

I created a special PHP script that delivers a 1x1 transparent PNG and records actions given like above.

PHP file eg. tic.php
<?
if (!isset($_REQUEST['a1']) || !isset($_REQUEST['a2']) || !isset($_REQUEST['a3']) || empty($_REQUEST['a1']) || empty($_REQUEST['a2']) || empty($_REQUEST['a3'])) {
header("HTTP/1.0 400 Bad Request");
echo "<h1>400 Bad Request</h1> <p>Parameters missing.</p>";
exit();
}
require_once('/path/to/owa/owa_php.php'); // adapt this
$owa = new owa_php();
$owa->setSiteId('01234567890affe'); // adapt this
$owa->setPageTitle('General Action Tracker');
$owa->setPageType('Tracker');
$owa->trackAction($_REQUEST['a1'], $_REQUEST['a2'], $_REQUEST['a3'], 1);
$owa->trackPageView();
header('Content-Type: image/png');
echo base64_decode('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=');
?>

Now put your nice little transparent pixel everywhere with different actions.

How to use
https://your.tld/tic.php?a1=GROUP&a2=NAME&a3=LABEL

Example
https://your.tld/tic.php?a1=Outlook%20Appointments&a2=Jour%20Fixe%20Hancock&a3=Opened

Sorry for spamming the issue tracker.

zecman commented Jan 16, 2018

Found a smarter way and will answer this by myself. :-)

I created a special PHP script that delivers a 1x1 transparent PNG and records actions given like above.

PHP file eg. tic.php
<?
if (!isset($_REQUEST['a1']) || !isset($_REQUEST['a2']) || !isset($_REQUEST['a3']) || empty($_REQUEST['a1']) || empty($_REQUEST['a2']) || empty($_REQUEST['a3'])) {
header("HTTP/1.0 400 Bad Request");
echo "<h1>400 Bad Request</h1> <p>Parameters missing.</p>";
exit();
}
require_once('/path/to/owa/owa_php.php'); // adapt this
$owa = new owa_php();
$owa->setSiteId('01234567890affe'); // adapt this
$owa->setPageTitle('General Action Tracker');
$owa->setPageType('Tracker');
$owa->trackAction($_REQUEST['a1'], $_REQUEST['a2'], $_REQUEST['a3'], 1);
$owa->trackPageView();
header('Content-Type: image/png');
echo base64_decode('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=');
?>

Now put your nice little transparent pixel everywhere with different actions.

How to use
https://your.tld/tic.php?a1=GROUP&a2=NAME&a3=LABEL

Example
https://your.tld/tic.php?a1=Outlook%20Appointments&a2=Jour%20Fixe%20Hancock&a3=Opened

Sorry for spamming the issue tracker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment