Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
S
stats-facil
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
facil
stats-facil
Validations
c7fb8b82
Valider
c7fb8b82
rédigé
9 years ago
par
mattab
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Minor change, renaming variable
parent
d615d752
Aucune branche associée trouvée
Branches contenant la validation
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
core/Tracker/Visit.php
+14
-15
14 ajouts, 15 suppressions
core/Tracker/Visit.php
tests/PHPUnit/Integration/Tracker/PingRequestTest.php
+2
-1
2 ajouts, 1 suppression
tests/PHPUnit/Integration/Tracker/PingRequestTest.php
avec
16 ajouts
et
16 suppressions
core/Tracker/Visit.php
+
14
−
15
Voir le fichier @
c7fb8b82
...
@@ -115,35 +115,34 @@ class Visit implements VisitInterface
...
@@ -115,35 +115,34 @@ class Visit implements VisitInterface
*/
*/
$isManualGoalConversion
=
$requestIsEcommerce
=
$visitIsConverted
=
$someGoalsConverted
=
false
;
$isManualGoalConversion
=
$requestIsEcommerce
=
$visitIsConverted
=
$someGoalsConverted
=
false
;
$action
=
null
;
$action
=
null
;
$
this
->
goalManager
=
null
;
$goalManager
=
null
;
if
(
$this
->
isPingRequest
())
{
if
(
$this
->
isPingRequest
())
{
// on a ping request that is received before the standard visit length, we just update the visit time w/o adding a new action
// on a ping request that is received before the standard visit length, we just update the visit time w/o adding a new action
if
(
$this
->
isPingRequest
())
{
Common
::
printDebug
(
"-> ping=1 request: we do not track a new action nor a new visit nor any goal."
);
Common
::
printDebug
(
"-> ping=1 request: we do not track a new action nor a new visit."
);
}
}
else
{
}
else
{
$this
->
goalManager
=
new
GoalManager
(
$this
->
request
);
$isManualGoalConversion
=
$this
->
goalManager
->
isManualGoalConversion
();
$goalManager
=
new
GoalManager
(
$this
->
request
);
$requestIsEcommerce
=
$this
->
goalManager
->
requestIsEcommerce
;
$isManualGoalConversion
=
$goalManager
->
isManualGoalConversion
();
$requestIsEcommerce
=
$goalManager
->
requestIsEcommerce
;
if
(
$requestIsEcommerce
)
{
if
(
$requestIsEcommerce
)
{
$someGoalsConverted
=
true
;
$someGoalsConverted
=
true
;
// Mark the visit as Converted only if it is an order (not for a Cart update)
// Mark the visit as Converted only if it is an order (not for a Cart update)
if
(
$
this
->
goalManager
->
isGoalAnOrder
())
{
if
(
$goalManager
->
isGoalAnOrder
())
{
$visitIsConverted
=
true
;
$visitIsConverted
=
true
;
}
}
}
elseif
(
$isManualGoalConversion
)
{
}
elseif
(
$isManualGoalConversion
)
{
// this request is from the JS call to piwikTracker.trackGoal()
// this request is from the JS call to piwikTracker.trackGoal()
$someGoalsConverted
=
$
this
->
goalManager
->
detectGoalId
(
$this
->
request
->
getIdSite
());
$someGoalsConverted
=
$goalManager
->
detectGoalId
(
$this
->
request
->
getIdSite
());
$visitIsConverted
=
$someGoalsConverted
;
$visitIsConverted
=
$someGoalsConverted
;
// if we find a idgoal in the URL, but then the goal is not valid, this is most likely a fake request
// if we find a idgoal in the URL, but then the goal is not valid, this is most likely a fake request
if
(
!
$someGoalsConverted
)
{
if
(
!
$someGoalsConverted
)
{
Common
::
printDebug
(
'Invalid goal tracking request for goal id = '
.
$
this
->
goalManager
->
idGoal
);
Common
::
printDebug
(
'Invalid goal tracking request for goal id = '
.
$goalManager
->
idGoal
);
return
;
return
;
}
}
}
else
{
}
else
{
...
@@ -152,7 +151,7 @@ class Visit implements VisitInterface
...
@@ -152,7 +151,7 @@ class Visit implements VisitInterface
$action
->
writeDebugInfo
();
$action
->
writeDebugInfo
();
$someGoalsConverted
=
$
this
->
goalManager
->
detectGoalsMatchingUrl
(
$this
->
request
->
getIdSite
(),
$action
);
$someGoalsConverted
=
$goalManager
->
detectGoalsMatchingUrl
(
$this
->
request
->
getIdSite
(),
$action
);
$visitIsConverted
=
$someGoalsConverted
;
$visitIsConverted
=
$someGoalsConverted
;
$action
->
loadIdsFromLogActionTable
();
$action
->
loadIdsFromLogActionTable
();
...
@@ -184,8 +183,8 @@ class Visit implements VisitInterface
...
@@ -184,8 +183,8 @@ class Visit implements VisitInterface
$idReferrerActionName
=
$this
->
visitorInfo
[
'visit_exit_idaction_name'
];
$idReferrerActionName
=
$this
->
visitorInfo
[
'visit_exit_idaction_name'
];
try
{
try
{
if
(
$
this
->
goalManager
)
{
if
(
$goalManager
)
{
$
this
->
goalManager
->
detectIsThereExistingCartInVisit
(
$this
->
visitorInfo
);
$goalManager
->
detectIsThereExistingCartInVisit
(
$this
->
visitorInfo
);
}
}
$this
->
handleExistingVisit
(
$visitor
,
$action
,
$visitIsConverted
);
$this
->
handleExistingVisit
(
$visitor
,
$action
,
$visitIsConverted
);
...
@@ -237,14 +236,14 @@ class Visit implements VisitInterface
...
@@ -237,14 +236,14 @@ class Visit implements VisitInterface
// record the goals if applicable
// record the goals if applicable
if
(
$someGoalsConverted
)
{
if
(
$someGoalsConverted
)
{
$
this
->
goalManager
->
recordGoals
(
$goalManager
->
recordGoals
(
$visitor
,
$visitor
,
$this
->
visitorInfo
,
$this
->
visitorInfo
,
$this
->
visitorCustomVariables
,
$this
->
visitorCustomVariables
,
$action
$action
);
);
}
}
unset
(
$this
->
goalManager
);
unset
(
$action
);
unset
(
$action
);
$this
->
markArchivedReportsAsInvalidIfArchiveAlreadyFinished
();
$this
->
markArchivedReportsAsInvalidIfArchiveAlreadyFinished
();
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
tests/PHPUnit/Integration/Tracker/PingRequestTest.php
+
2
−
1
Voir le fichier @
c7fb8b82
...
@@ -77,7 +77,8 @@ class PingRequestTest extends IntegrationTestCase
...
@@ -77,7 +77,8 @@ class PingRequestTest extends IntegrationTestCase
// send a ping request within 30 minutes
// send a ping request within 30 minutes
$pingTime
=
'2012-01-05 00:20:00'
;
$pingTime
=
'2012-01-05 00:20:00'
;
// force trigger a goal
// force trigger a goal within the ping request
$tracker
->
setDebugStringAppend
(
'&idgoal=1'
);
$tracker
->
setDebugStringAppend
(
'&idgoal=1'
);
$this
->
doPingRequest
(
$tracker
,
$pingTime
,
$setNewDimensionValues
=
true
);
$this
->
doPingRequest
(
$tracker
,
$pingTime
,
$setNewDimensionValues
=
true
);
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter