table of contents note: visitors is dependent on the extensions "botdetection bundle" and...

31

Upload: others

Post on 25-Jan-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

  • 1. Introduction2. OverviewVisitors3. InstallationofVisitors4. OverviewFrontend/Backend

    i. Backendii. Frontend

    5. Usingi. Createthecategoryii. Createnewcounteriii. Createthefrontendmoduleiv. ActivatedemoCSSfile

    6. Technicaldetailsi. Technicaldetailscounterdefinitionii. Technicaldetailsfrontendmoduledefinition

    7. InsertTagsi. Showthevaluesii. Countiii. MoreInsertTags

    8. Specificfeaturesi. Nocountingii. Visitorsperday:Ø=0iii. Botdetectionoff

    9. Dataprivacyi. Datacollectionii. Datastorageiii. Datamanagement

    TableofContents

    ManualforContao4extensionVisitorsBundle-

    -2-

  • ThisisthemanualforusersofVisitorsBundle.Youcanalwaysfindthelatestversionondocs.contao.ninja.

    I'mnotanativeEnglishspeaker.Pleasecorrectmymistakes,writeanissueorsendapullrequest.ManyThanks.

    OverviewVisitorsInstallationofVisitorsOverviewFrontend/Backend

    BackendFrontend

    UsingCreatethecategoryCreatenewcounterCreatethefrontendmoduleActivatedemoCSSfile

    TechnicaldetailsTechnicaldetailscounterdefinitionTechnicaldetailsfrontendmoduledefinition

    InsertTagsShowthevaluesCountMoreInsertTags

    SpecificfeaturesNocountingVisitorsperday:Ø=0Botdetectionoff

    DataprivacyDatacollectionDatastorageDatamanagement

    AlldocumentationsofBugBuster1701@GitHublicensedunderaCreativeCommonsAttribution3.0License(CCBY-NC-SA3.0).Ifyouwanttoredistributeamodifiedorunmodifiedversionofthedocumentation,youcandosounderthelicenseterms.

    Ifyoucontributetothedocumentation,e.g.bycreatingpullrequests,yougrantusfullusagerightsofanycontentyoucreateorupload.Youalsoensurethatyourcontentdoesnotviolateanythird-partyrights.

    Wearenotclaimingexclusiveusagerights,thereforeyouarefreetouseyourcontributedcontent(e.g.

    ManualforContao4extensionVisitorsBundle

    Tableofcontents

    Licence

    ManualforContao4extensionVisitorsBundle-Introduction

    -3-

    http://docs.contao.ninja/https://github.com/BugBuster1701/docs/issueshttp://creativecommons.org/licenses/by-nc-sa/3.0/

  • textsorimages)inanyotherprojectaswell.

    ManualforContao4extensionVisitorsBundle-Introduction

    -4-

  • Thisextensionallowsyoutocounthitsandvisitsofyourwebsite.

    Inthedisplayappearsthehitsandvisitsfromthecurrentday,aswellastherespectivetotal.Inthebackendthereareastatisticoverview.

    VisitorsBundleusedtheextension"BotDetectionBundle".Thispreventscountingoftrafficfrombots/searchengines.Butthereisno100%guarantee.

    Information Link

    DeveloperWebsite http://contao.ninja

    LinktoExtensionRepository(Packagist) Packagist.org

    Donatethedeveloper Amazonwishlist(german)

    ReportIssues/FeatureRequests GitHub

    Contaoforumforquestions community.contao.org

    TranslationsofthetextsintheBackendandthefrontendaremanagedwithusingofTransifex.Tocreateanewtranslationortohelptomaintainanexistingone,pleaseregisterattransifex.com.

    ProjektLink:https://www.transifex.com/projects/p/contao-visitors/

    Howto(english):http://docs.transifex.com/faq/#translating

    Overview

    Helpfullinks

    Translations

    ManualforContao4extensionVisitorsBundle-OverviewVisitors

    -5-

    http://contao.ninjahttps://packagist.org/packages/bugbuster/contao-visitors-bundlehttp://www.amazon.de/wishlist/26HHEJOU03G76https://github.com/BugBuster1701/contao-visitors-bundle/issueshttps://community.contao.org/en/forumdisplay.php?143https://www.transifex.com/projects/p/contao-visitors-bundle/http://docs.transifex.com/faq/#translating

  • Therearetwotypesofinstallation.

    withtheContao-Manger,onlyforContaoManaged-Editonviathecommandline,forContaoStandard-EditionandManaged-Editon

    Note:Visitorsisdependentontheextensions"BotDetectionBundle"and"phpoffice/phpexcel",theseareinstalledautomaticallyinmostcases.

    LinktoPackagist:VisitorsonPackagist.org

    searchforpackage:bugbuster/contao-visitors-bundleinstallthepackageClickon"InstallTool"Loginandupdatethedatabase

    InstallationinaComposer-basedContao4.3+Managed-Edition:

    composerrequire"bugbuster/contao-visitors-bundle"

    Callhttp://yourdomain/contao/installLoginandupdatethedatabase

    InstallationinaComposer-basedContao4.3+Standard-Edition

    composerrequire"bugbuster/contao-visitors-bundle"

    Addinapp/AppKernel.phpfollowinglineattheendofthe$bundlesarray.

    newBugBuster\VisitorsBundle\BugBusterVisitorsBundle(),

    Clearsthecacheandwarmsupanemptycache:

    vendor/bin/contao-consolecache:clear--env=prod

    vendor/bin/contao-consolecache:warmup-eprod

    Callhttp://yourdomain/contao/installLoginandupdatethedatabase

    InstallationofVisitorsBundle

    InstallationwithContao-Manager

    Installationviacommandline

    InstallationforContaoManaged-Edition

    InstallationforContaoStandard-Edition

    ManualforContao4extensionVisitorsBundle-InstallationofVisitors

    -6-

    https://packagist.org/packages/bugbuster/contao-visitors-bundlehttp://yourdomain/contao/installhttp://yourdomain/contao/install

  • TheVisitorsextensioncontainstwobackendandonefrontendmodule.Inthebackend,thereisthemodule"Visitors",heretheCounteraredefinedandfirstsettings,aswellasthemodule"Visitorstatistics",herethestatisticscanbeviewed.

    Forthefrontendthereisthemodule"Visitors".Byselectingoneofthesuppliedtemplatescaneitheronlycountoralsodisplaytotalsofvisitorsandhits.

    Detailswillfollowinthenextchapters.

    OverviewFrontend/Backend

    ManualforContao4extensionVisitorsBundle-OverviewFrontend/Backend

    -7-

  • TheVisitorsmodulecanbefoundunderContent->Visitor.

    TheVisitorStatisticsmodulecanbefoundunderSystem->VisitorStatistics

    Itshowsthestatisticsforthecreatedcounter.Ifyouhavecreatedmultiplecounters,foramultidomaininstallation,thecountercanbeselected.

    Aselectionofthestatistics:

    Backend

    Visitors

    VisitorStatistics

    ManualforContao4extensionVisitorsBundle-Backend

    -8-

  • ManualforContao4extensionVisitorsBundle-Backend

    -9-

  • (TOP20listsareshortened.)

    ManualforContao4extensionVisitorsBundle-Backend

    -10-

  • ForthefrontendareincludedtwoCSSfilesasanexampleofadisplayformat:

    mod_visitors_fe.cssforthenormaloutput,linebylinemod_visitors_fe_horizontal.cssforthehorizontaloutput

    Viewwhenusingthetemplatemod_visitors_fe_all:

    Viewwhenusingthetemplatemod_visitors_fe_all:

    Frontend

    VisitorsStatisticslinebyline

    VisitorsStatisticshorizontaloutput

    ManualforContao4extensionVisitorsBundle-Frontend

    -11-

  • Atfirst,youcreateanewvisitorcategoryviathemenuitem"Visitors".Inthisthenthecounter.

    Then,createafrontendmoduleandbuilditintothelayoutofthepage.

    Herefollowthesteps,eachwiththedefaultvalues.Technicaldetailswillbeexplainedlater.

    Using

    ManualforContao4extensionVisitorsBundle-Using

    -12-

  • Tocreateanewcategory,justclickontheleftinthebackendin'Content'on'Visitors'.Inthemainareaclickonthebutton'Newcategory'.

    There,enterthenameofthecategory.Thefrontendmodulewilllaterusethisname.Thenyouclickon"Saveandclose".Nowyoucanseethecategoryoverview.Byclickingonthepencilinthelineofthecategoryandrepeatedclickingonthepencilintheheadofthecategoryyoureturntothesettingsofthecategory.

    Createthecategory

    ManualforContao4extensionVisitorsBundle-Createthecategory

    -13-

  • InthecategorylistnowclickingonEdit(pencil)ofthecategory.Now,eitherclickthe'Newcounter'andthenthearrowicon,orclicktheplusintheheadofthecategory:

    Now,someinformationwillberequired:

    Name,(isdisplayedasaheadingonthenumbers).Startdate,optional,onlyfordisplayinfontendOptional:'Initialvalueofvisitors/hits'Optional:'Visitorsperday'Activate"Published"

    Thenyouclickon"Saveandclose".

    Createnewcounter

    ManualforContao4extensionVisitorsBundle-Createnewcounter

    -14-

  • Anewfront-endmoduleiscreatewith:

    Layout->Themes->Modules->Addmodule

    Atfirst,enterthetitle,andonlythenselectin"Moduletype":'Miscellaneous'-'Visitors'.Itchangestheformfields.In'Visitorscategory'nowselectthepreviouslycreatedcategory,then'Saveandclose'.

    Now,thefrontendmodulemustbeincludedinthelayout:

    Layout->Themes->Layout->Edittheusedlayout

    Includein'Includedmodules'thejust-createdfrontendmodule(e.g.toleft)

    Createthefrontendmodule

    ManualforContao4extensionVisitorsBundle-Createthefrontendmodule

    -15-

  • Asmentionedabove,areprovidedtwoCSSfileforpresentation.Forthefirsttests,copythefilemod_visitors_fe.cssfromthe/web/bundles/bugbustervisitors/css_demoonthelocalPCandthenimportviathebackend(Themes->CSS->Import)andactivateitinthelayout.

    ActivatedemoCSSfile

    ManualforContao4extensionVisitorsBundle-ActivatedemoCSSfile

    -16-

  • Technicaldetailsareinsideofthecategory,inthecounterdefinitionandinthegeneratedfrontendmodule.Thisappliestothenotpreviouslymentionedformfieldsandthedifferentfrontendtemplatesthatareincluded.

    Technicaldetails

    ManualforContao4extensionVisitorsBundle-Technicaldetails

    -17-

  • Theblocktimeisinseconds.Afterinterruptionoftherequestsatthistime,anaccessfromthesameIPiscountedasanadditionalvisitor.

    Defaultare1800seconds,thatare30minutes.

    Technicaldetailscounterdefinition

    Blocktime

    ManualforContao4extensionVisitorsBundle-Technicaldetailscounterdefinition

    -18-

  • EachfrontendmodulecanbeassigneditsownTemplate.Fourdifferenttemplatesareincluded.

    mod_visitors_fe_all

    Allfieldsareincluded.(seeexampleabove)mod_visitors_fe_hits

    Herethevisitrowswereremoved.mod_visitors_fe_visits

    Herethehitrowswereremoved.mod_visitors_fe_invisible

    Here,nothingisdisplayed.Thistemplateisusedforapurecounting.

    ForownTemplates,thetemplatefilesmuststartwithmod_visitors_fe_andendwith.html5.

    Hidethemoduleifamember(frontenduser)isloggedin.

    Showthemoduletocertainmembergroupsonly.

    Youcansetacustom"UserAgentString"inyourbrowserandinthevisitorsmoduleconfiguration.

    Layout->Themes->Modules->ModuleName

    Inthefield:"NocountingforthisHTTP_USER_AGENTpartialidentifier",youcanenterauniqueidentifier.Example:CTISOK

    Inyourbrowser,anadd-onshouldbeused.ForFirefoxthatwould,forexample,theUserAgentSwitcher

    Technicaldetailsfrontendmoduledefinition

    Templates

    Showtoguestsonly

    Protectmodule

    NocountingforthisHTTP_USER_AGENTpartialidentifier

    ManualforContao4extensionVisitorsBundle-Technicaldetailsfrontendmoduledefinition

    -19-

    https://addons.mozilla.org/de/firefox/addon/user-agent-switcher/

  • InsertTagsarewildcardsthatarereplacedwithdynamiccontentwhenapageisprintedtothescreen.Thefrontendmoduleusedinserttags.Auserneedsthisonlyifthefrontendmoduleisnottobeused,butthefunctionsoftheextension.

    ThereistheInsertTagtocountthevisitors,toshowthecurrentvalues(Visitors,Hits)andforthevaluesofthedaywiththemostvisitors.

    InsertTags

    ManualforContao4extensionVisitorsBundle-InsertTags

    -20-

  • {{visitors::catid::name}}{{visitors::catid::online}}{{visitors::catid::start}}{{visitors::catid::totalvisit}}{{visitors::catid::totalhit}}{{visitors::catid::todayvisit}}{{visitors::catid::todayhit}}{{visitors::katid::yesterdayvisit}}{{visitors::katid::yesterdayhit}}{{visitors::katid::averagevisits}}{{visitors::katid::pagehits}}

    InsertTagcanbeextendedwithprefix'cache_'.Thus,thesethencacheresistant.ThismeansthatwhenapagecomesfromtheContaocache,thenpreviouslyareinsertedthecurrentvalues.

    {{cache_visitors::catid::name}}...

    Thecountingiscontinuedthroughthemodule!Whowantstousetodisplaytheinserttags,themodulecontinuestoneed,butonlytocount.Withthetemplatesmod_visitors_fe_invisiblethemodulemaybeinvisible,ifdesired.

    TodeterminethecategoryID,gointothecategoryoverviewofthemodulewithyourmouseoverthe"i"orlookatrightbehindthecategoryname.

    ForcategoryID=1thatwouldbelikethat:

    {{visitors::1::online}}

    Showthevalues

    ManualforContao4extensionVisitorsBundle-Showthevalues

    -21-

  • Analternativeto"countingonly"wouldbetouseanInsertTag.Thefontendmoduleitselfusesthisaswell:

    {{cache_visitors::catid::count}}

    Exampleforinstallationinanarticle(forcategoryID=1):

    {{cache_visitors::1::count}}

    Itmustbenoted,thattheInsertTagforthecountwillbeinstalledatfirstonthepage,sothatthecountingisperformedoutbeforethedeterminationofthevalues.

    Count

    ManualforContao4extensionVisitorsBundle-Count

    -22-

  • ThereareInsertTagsfordisplaythevaluesofthedaywiththemostvisitors.

    {{visitors::catid::bestday::date}}-Day(Date)withthemostvisitors{{visitors::catid::bestday::visits}}-Numberofvisitorsofthedaywithmostvisitors{{visitors::catid::bestday::hits}}-Numberofhitsofthedaywithmostvisitorsor{{cache_visitors::catid::bestday::date}}{{cache_visitors::catid::bestday::visits}}{{cache_visitors::catid::bestday::hits}}

    The"date"insert-taghasanoptionalparametertoformatthedateoutput.(m.d.Y,Y-m-d,etc.)Thesystemsettingisusedasdefault.Asaseparator,a"::"areused.

    Acompleteexample(withcategory1):

    BestDay:{{visitors::1::bestday::date::j.FY}}with{{visitors::1::bestday::visits}}visitors(and{{visitors::1::bestday::hits}}hits)

    results:

    BestDay:31.August2010with25visitors(and123hits)

    MoreInsertTags

    ManualforContao4extensionVisitorsBundle-MoreInsertTags

    -23-

  • Herearesomespecificsthatmustbeobserved.

    Specificfeatures

    ManualforContao4extensionVisitorsBundle-Specificfeatures

    -24-

  • Nofrontendaccessiscountedwhenyouareloggedonatthesametimeinthebackend.

    Nocounting

    ManualforContao4extensionVisitorsBundle-Nocounting

    -25-

  • Theaveragevalueperdaywillbecalculatedforeachfullcalendarday.So,havingonlyonedaybeforeacountingoracountingofthecurrentday,nomeaningfulvaluecanbecalculated.(average=numbervisitors)Inthesecasesappears"0".

    Visitorsperday:Ø=0

    ManualforContao4extensionVisitorsBundle-Visitorsperday:Ø=0

    -26-

  • Whowantstocountthehitsfrombotsandsearchengines,canswitchoffthebotdetection.Thisismadebythefilelocalconfig.php.

    ThisappliestoallVisitorsmoduleswhenseveralfrontendmoduleshavebeencreated!

    Thefollowingentrytotheendoflocalconfig.php(after:###INSTALLSCRIPTSTOP###)switchingoffthebotdetection:

    $GLOBALS['TL_CONFIG']['mod_visitors_bot_check']=false;

    BotDetectionoff

    ManualforContao4extensionVisitorsBundle-Botdetectionoff

    -27-

  • Afewwordsaboutdataprivacy.Unlikemostothervisitorstatisticstools,Visitorsdoesnotstoretherawdataandevaluatesthemlater.Thenecessaryevaluationsareexecutedimmediately.Thefinalstatisticsaresaved,exceptfortheIPaddress,seethenotesinthefollowingchapters.Thus,thetargetofdataavoidanceanddataminimizationisreachedoptimally.

    Dataprivacy

    ManualforContao4extensionVisitorsBundle-Dataprivacy

    -28-

  • FordetectingofdifferentvisitorstheIPaddressisusedexclusively.JavaScriptandcookiesarenotused.

    Foradditionalstatisticsthebrowseragentisreadandthereferrer,ifavailable.BothwillbeseparatelysavedregardlessoftheIPaddress,andmaythereforenotbeassociated.(purecounting)

    Datacollection

    IPaddress

    Browser-AgentandReferrer

    ManualforContao4extensionVisitorsBundle-Datacollection

    -29-

  • Itwillnotbestored,theIPaddressofthevisitor.Exceptfordetectingbots/crawler/spider,theIPaddressisalsonotusedforfurtheranalysispurposes.WiththeIPaddressandotherinternaldataapseudonymisgeneratedintheformofahashvalue.Areversecalculationisconceivable,butonlywithconsiderableeffort.Thehashvalueisnotassociatedwithanyotherstatisticalanalysis.

    Forthebrowseragent,itstoresthecombinationsofbrowser,language,OSwithacountvalue,notthecompleteAgentstring.WhenthereferrerURLisstoredwithcountvalueandtimestampofthelastoccurrence,withnolinktoIPaddressorbrowseragent.

    Datastorage

    IPaddress

    Browser-AgentandReferrer

    ManualforContao4extensionVisitorsBundle-Datastorage

    -30-

  • Thehashvaluesforthedetectionofdifferentvisitorsarecheckedwitheverycall,Elapsedtimehashvalueswillbedeleted.Holdingtimeisequivalenttotheblocktime,thedefaultvalueis1800seconds,ie30minutes.Referrervaluesarecurrentlydeleteddependingonthetypeafter90or120days.

    Thenumberofvisitors/hitsperdayisstoredpermanently,theotherevaluationsaregeneratedfromit.Thisstoragecanbedeletedviathebackend,thecounterstartsthenagainat0.

    Datamanagement

    ManualforContao4extensionVisitorsBundle-Datamanagement

    -31-

    IntroductionOverview VisitorsInstallation of VisitorsOverview Front end / Back endBack endFront end

    UsingCreate the categoryCreate new counterCreate the front end moduleActivate demo CSS file

    Technical detailsTechnical details counter definitionTechnical details front end module definition

    Insert TagsShow the valuesCountMore Insert Tags

    Specific featuresNo countingVisitors per day: Ø = 0Bot detection off

    Data privacyData collectionData storageData management