Skip to content

Commit

Permalink
Merge branch 'release/36.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
einpraegsam committed Jul 31, 2024
2 parents 54da30b + 1b642c3 commit 726daf3
Show file tree
Hide file tree
Showing 22 changed files with 54,641 additions and 83 deletions.
14 changes: 7 additions & 7 deletions Classes/Controller/FrontendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use In2code\Lux\Domain\Tracker\NewsTracker;
use In2code\Lux\Domain\Tracker\PageTracker;
use In2code\Lux\Domain\Tracker\SearchTracker;
use In2code\Lux\Domain\Tracker\VirtualPageTracker;
use In2code\Lux\Domain\Tracker\EventTracker;
use In2code\Lux\Events\AfterTrackingEvent;
use In2code\Lux\Exception\ActionNotAllowedException;
use In2code\Lux\Exception\ConfigurationException;
Expand All @@ -46,14 +46,14 @@ class FrontendController extends ActionController
protected ConfigurationService $configurationService;
protected CompanyTracker $companyTracker;
protected PageTracker $pageTracker;
protected VirtualPageTracker $virtualPageTracker;
protected EventTracker $eventTracker;
protected NewsTracker $newsTracker;
protected SearchTracker $searchTracker;
protected $eventDispatcher;
protected LoggerInterface $logger;
protected array $allowedActions = [
'pageRequest',
'virtualPageRequest',
'eventTrackRequest',
'searchRequest',
'fieldListeningRequest',
'formListeningRequest',
Expand All @@ -69,7 +69,7 @@ public function __construct(
ConfigurationService $configurationService,
CompanyTracker $companyTracker,
PageTracker $pageTracker,
VirtualPageTracker $virtualPageTracker,
EventTracker $eventTracker,
NewsTracker $newsTracker,
SearchTracker $searchTracker,
EventDispatcherInterface $eventDispatcher,
Expand All @@ -78,7 +78,7 @@ public function __construct(
$this->configurationService = $configurationService;
$this->companyTracker = $companyTracker;
$this->pageTracker = $pageTracker;
$this->virtualPageTracker = $virtualPageTracker;
$this->eventTracker = $eventTracker;
$this->newsTracker = $newsTracker;
$this->searchTracker = $searchTracker;
$this->eventDispatcher = $eventDispatcher;
Expand Down Expand Up @@ -147,11 +147,11 @@ public function pageRequestAction(string $identificator, array $arguments): Resp
* @return ResponseInterface
* @noinspection PhpUnused
*/
public function virtualPageRequestAction(string $identificator, array $arguments): ResponseInterface
public function eventTrackRequestAction(string $identificator, array $arguments): ResponseInterface
{
try {
$visitor = $this->getVisitor($identificator);
$this->virtualPageTracker->track($visitor, $arguments);
$this->eventTracker->track($visitor, $arguments);
return $this->jsonResponse(json_encode($this->afterAction($visitor)));
} catch (Throwable $exception) {
return $this->jsonResponse(json_encode($this->getError($exception)));
Expand Down
8 changes: 4 additions & 4 deletions Classes/Domain/LogEventListeners/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use In2code\Lux\Events\Log\LogVisitorIdentifiedByLuxletterlinkEvent;
use In2code\Lux\Events\Log\SearchEvent;
use In2code\Lux\Events\Log\UtmEvent;
use In2code\Lux\Events\Log\VirtualPageTrackerEvent;
use In2code\Lux\Events\Log\EventTrackerEvent;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException;
use TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException;
Expand Down Expand Up @@ -123,14 +123,14 @@ public function logEmail4LinkEmailFailed(LogEmail4linkSendEmailFailedEvent $even
}

/**
* @param VirtualPageTrackerEvent $event
* @param EventTrackerEvent $event
* @return void
* @throws IllegalObjectTypeException
* @throws UnknownObjectException
*/
public function logVirtualPageRequest(VirtualPageTrackerEvent $event): void
public function logEventTrackRequest(EventTrackerEvent $event): void
{
$this->logService->logVirtualPageRequest($event->getVisitor(), $event->getParameter());
$this->logService->logEventTrackRequest($event->getVisitor(), $event->getParameter());
}

/**
Expand Down
6 changes: 3 additions & 3 deletions Classes/Domain/Model/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Log extends AbstractModel
public const STATUS_PAGEVISIT3 = 41;
public const STATUS_PAGEVISIT4 = 42;
public const STATUS_PAGEVISIT5 = 43;
public const STATUS_VIRTUALPAGEVISIT = 48;
public const STATUS_EVENTTRACK = 48;
public const STATUS_DOWNLOAD = 50;
public const STATUS_SEARCH = 55;
public const STATUS_ACTION = 60;
Expand Down Expand Up @@ -167,9 +167,9 @@ public function getSearch(): ?Search
return $searchRepository->findByIdentifier($searchUid);
}

public function getVirtualPath(): string
public function getEventName(): string
{
return $this->getPropertyByKey('virtualPath');
return $this->getPropertyByKey('eventName');
}

public function getLinklistener(): ?Linklistener
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Repository/LogRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ protected function interestingLogsLogicalAnd(QueryInterface $query): array
);
if ($configString === '') {
// In some rare cases TypoScript is not available in backend module even if TS is included in root template
$configString = '2,3,25,28,26,21,22,23,50,55,60,70,80,100';
$configString = '2,3,25,28,26,21,22,23,48,50,55,60,70,80,100';
}
$status = GeneralUtility::trimExplode(',', $configString, true);
return [
Expand Down
4 changes: 2 additions & 2 deletions Classes/Domain/Service/LogService.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ public function logEmail4LinkEmailFailed(Visitor $visitor, string $href): void
* @throws IllegalObjectTypeException
* @throws UnknownObjectException
*/
public function logVirtualPageRequest(Visitor $visitor, string $parameter): void
public function logEventTrackRequest(Visitor $visitor, string $parameter): void
{
$this->log(Log::STATUS_VIRTUALPAGEVISIT, $visitor, ['virtualPath' => $parameter]);
$this->log(Log::STATUS_EVENTTRACK, $visitor, ['eventName' => $parameter]);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
namespace In2code\Lux\Domain\Tracker;

use In2code\Lux\Domain\Model\Visitor;
use In2code\Lux\Events\Log\VirtualPageTrackerEvent;
use In2code\Lux\Events\Log\EventTrackerEvent;
use Psr\EventDispatcher\EventDispatcherInterface;

class VirtualPageTracker
class EventTracker
{
private EventDispatcherInterface $eventDispatcher;

Expand All @@ -18,6 +18,6 @@ public function __construct(EventDispatcherInterface $eventDispatcher)

public function track(Visitor $visitor, array $arguments)
{
$this->eventDispatcher->dispatch(new VirtualPageTrackerEvent($visitor, $arguments['parameter'], $arguments));
$this->eventDispatcher->dispatch(new EventTrackerEvent($visitor, $arguments['parameter'], $arguments));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use In2code\Lux\Domain\Model\Visitor;

final class VirtualPageTrackerEvent
final class EventTrackerEvent
{
protected Visitor $visitor;
protected string $parameter;
Expand Down
6 changes: 3 additions & 3 deletions Configuration/Services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ services:
method: 'logEmail4LinkEmailFailed'
event: In2code\Lux\Events\Log\LogEmail4linkSendEmailFailedEvent
- name: 'event.listener'
identifier: 'lux/logVirtualPageRequest'
method: 'logVirtualPageRequest'
event: In2code\Lux\Events\Log\VirtualPageTrackerEvent
identifier: 'lux/logEventTrackRequest'
method: 'logEventTrackRequest'
event: In2code\Lux\Events\Log\EventTrackerEvent
- name: 'event.listener'
identifier: 'lux/logDownload'
method: 'logDownload'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ lib.lux.settings {
activity {
# Look at \In2code\Lux\Domain\Model\Log::STATUS_... for some status definitions
# Falback values are defined in LogRepository::interestingLogsLogicalAnd
defineLogStatusForInterestingLogs = 2,3,25,28,26,21,22,23,50,55,60,70,80,100
defineLogStatusForInterestingLogs = 2,3,25,28,26,21,22,23,48,50,55,60,70,80,100
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Documentation/Technical/Analysis/Index.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ in this item.
<img src="../../../Documentation/Images/screenshot_analysis_content.png" width="800" />

**Technical note:** Page visits will be automatically be tracked with LUX on normal TYPO3 pages. In some rare scenarios
you may want to push a virtual pagevisit to LUX. This can be helpful if you want to track accordion opens, multistep
you may want to push an interaction (event) to LUX. This can be helpful if you want to track accordion opens, multistep
forms or other content changes without page reload and without a different URL. You can push such a visit via JavaScript:

```
const lux = LuxSingleton.getInstance();
lux.push('applicationProcess/step1', 'virtualPageRequest');
lux.push('applicationProcess/step1', 'eventTrackRequest');
```

#### News
Expand Down
10 changes: 5 additions & 5 deletions Documentation/Technical/Campaigns/Workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Possible triggers by default are:
* Lead action: When lead enters a page or downloads an asset of a given category
* Lead action: When lead enters a page in a given language
* Lead action: When lead enters a page of a given site
* Lead action: When lead enters a virtual page
* Lead action: On any lead interaction (even tracking)
* Lead action: When lead searches for a specific searchterm
* Lead source: Check for a given referrer
* Lead source: Check for a given UTM parameter
Expand Down Expand Up @@ -385,16 +385,16 @@ lib.lux.settings {
}
}
# If lead visits a virtual page
# Event tracking of any interation
450 {
# Title to show in workflow backend module
title = LLL:EXT:luxenterprise/Resources/Private/Language/locallang_db.xlf:trigger.virtualpagevisit
title = LLL:EXT:luxenterprise/Resources/Private/Language/locallang_db.xlf:trigger.event
# Classname for implementation of the trigger itself
className = In2code\Luxenterprise\Domain\Workflow\Trigger\VirtualPageVisitTrigger
className = In2code\Luxenterprise\Domain\Workflow\Trigger\EventTrigger
# Templatefile for implementation of the form in workflow module
templateFile = EXT:luxenterprise/Resources/Private/Templates/Workflow/Trigger/VirtualPageVisit.html
templateFile = EXT:luxenterprise/Resources/Private/Templates/Workflow/Trigger/Event.html
# Additional configuration
configuration {
Expand Down
1 change: 1 addition & 0 deletions Documentation/Technical/Changelog/Index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Double check if you have cleared all caches after installing a new LUX version t

| Version | Date | State | TYPO3 | Description |
|------------|------------|----------|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 36.1.0 | 2024-07-31 | Task | `11.5 + 12.4` | Add a bunch of onetime mail domains to configuration, rename virtual page request to event tracking requests |
| 36.0.0 | 2024-07-28 | Feature | `11.5 + 12.4` | Add push service for virtual page visits or search usage (via JavaScript) |
| 35.11.0 | 2024-07-25 | Feature | `11.5 + 12.4` | Add {file} variable in Email4LinkMail.html email template for a better extendability |
| 35.10.0 | 2024-07-24 | Feature | `11.5 + 12.4` | Add quarter interval support in FilterDto to allow quarterly evaluation, added some unit tests |
Expand Down
2 changes: 1 addition & 1 deletion Documentation/Technical/Events/Index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Contact us if you need further events.
| AttributeTracker::addAttribute() | \In2code\Lux\Events\Log\LogVisitorIdentifiedByEmail4linkEvent | Do something when a visitor was just identified by method "Email4link" |
| AttributeTracker::addAttribute() | \In2code\Lux\Events\Log\LogVisitorIdentifiedByLuxletterlinkEvent | Do something when a visitor was just identified by method "Luxletterlink" |
| AttributeTracker::addAttribute() | \In2code\Lux\Events\Log\LogVisitorIdentifiedByFrontendauthenticationEvent | Do something when a visitor was just identified by method "Frontendauthentication" |
| VirtualPageTracker::track() | \In2code\Lux\Events\Log\VirtualPageTrackerEvent | Hook into pushs for virtual page visits |
| EventTracker::track() | \In2code\Lux\Events\Log\EventTrackerEvent | Hook into pushes for event tracks |
| AttributeTracker::getAndUpdateAttributeFromDatabase() | \In2code\Lux\Events\AttributeOverwriteEvent | This event can be used when an attribute of a visitor is updated |
| DownloadTracker::addDownload() | \In2code\Lux\Events\Log\DownloadEvent | This event can be used when a visitor downloads a file |
| FrontendController::afterAction() | \In2code\Lux\Events\AfterTrackingEvent | This event is used for every kind of frontend/tracking/ajax request in the Frontend Controller |
Expand Down
5 changes: 3 additions & 2 deletions Documentation/Technical/FAQ/Index.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,14 @@ plugin.tx_lux_fe.settings < lib.lux.settings
## How to track accordion opens or other content changes without page reload?

Page visits will be automatically be tracked with LUX on normal TYPO3 pages. In some rare scenarios
you may want to push a virtual pagevisit to LUX. This can be helpful if you want to track accordion opens, multistep
you may want to push an event after an interaction to LUX.
This can be helpful if you want to track accordion opens, multistep
forms or other content changes without page reload and without a different URL. You can simply push such a visit via
JavaScript:

```
const lux = LuxSingleton.getInstance();
lux.push('accordion 1 just opened', 'virtualPageRequest');
lux.push('accordion 1 just opened', 'eventTrackRequest');
```

## How to track searchterms with my AJAX onpage search?
Expand Down
8 changes: 4 additions & 4 deletions Resources/Private/Build/JavaScript/Frontend/Lux.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ function LuxMain() {
};

/**
* Allow to push virtual page requests or search requests to LUX
* Allow to push event requests or search requests to LUX
*
* @params {string} Any parameter. Typically, a virtual page like "antragsstrecke/step1" or searchterm like "product"
* @params {string} "virtualPageRequest" or "searchRequest"
* @params {string} Any parameter. Typically, an event track like "antragsstrecke/step1" or searchterm like "product"
* @params {string} "eventTrackRequest" or "searchRequest"
* @returns {void}
* @api
*/
this.push = function(parameter, to) {
const parameters = {
'tx_lux_fe[dispatchAction]': to || 'virtualPageRequest',
'tx_lux_fe[dispatchAction]': to || 'eventTrackRequest',
'tx_lux_fe[identificator]': identification.getIdentificator(),
'tx_lux_fe[arguments][pageUid]': getPageUid(),
'tx_lux_fe[arguments][languageUid]': getLanguageUid(),
Expand Down
4 changes: 2 additions & 2 deletions Resources/Private/Language/de.locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1104,8 +1104,8 @@
<target state="translated">Fünfter Seitenbesuch</target>
</trans-unit>
<trans-unit id="module.analysis.log.status.48">
<source>Virtual page visit</source>
<target state="translated">Virtueller Seitenbesuch</target>
<source>Tracked event</source>
<target state="translated">Event getrackt</target>
</trans-unit>
<trans-unit id="module.analysis.log.status.50">
<source>LUX tracked a download</source>
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Language/locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@
<source>Fifth page visit</source>
</trans-unit>
<trans-unit id="module.analysis.log.status.48">
<source>Virtual page visit</source>
<source>Tracked event</source>
</trans-unit>
<trans-unit id="module.analysis.log.status.50">
<source>LUX tracked a download</source>
Expand Down
3 changes: 2 additions & 1 deletion Resources/Private/Partials/Box/Miscellaneous/Log.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ <h3 class="panel-title">


<f:section name="status48">
"{log.virtualPath}"
"{log.eventName}"
<span title="UID:{log.visitor.uid}">(<f:link.action action="detail" controller="Lead" arguments="{visitor:log.visitor}">{log.visitor.fullName}</f:link.action>)</span>
</f:section>


Expand Down
Loading

0 comments on commit 726daf3

Please sign in to comment.