-
Notifications
You must be signed in to change notification settings - Fork 0
/
utmuser.php
executable file
·59 lines (50 loc) · 1.26 KB
/
utmuser.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* @package Joomla.Plugin
* @subpackage System.utmuser
*
* @copyright
* @license GPL V3
*/
defined('_JEXEC') or die;
/**
* Utmuser plugin class.
*
* @since 2.5
* @link https://docs.joomla.org/Plugin/Events/System
*/
class PlgSystemUtmuser extends JPlugin
{
/**
* After initialise.
*
* @return void
*
* @since 1.6
*/
public function onAfterInitialise()
{
$jinput = JFactory::getApplication()->input;
$session = JFactory::getSession();
$utm_source = $jinput->get('utm_source');
$utm_medium = $jinput->get('utm_medium');
$utm_campaign = $jinput->get('utm_campaign');
$utm_term = $jinput->get('utm_term');
$utm_content = $jinput->get('utm_content');
if (!empty($utm_source)) {
$session->set('utm_source', $utm_source);
}
if (!empty($utm_medium)) {
$session->set('utm_medium', $utm_medium);
}
if (!empty($utm_campaign)) {
$session->set('utm_campaign', $utm_campaign);
}
if (!empty($utm_term)) {
$session->set('utm_term', $utm_term);
}
if (!empty($utm_content)) {
$session->set('utm_content', $utm_content);
}
}
}