LoginMetrics for Churches with Campuses ======================================= The LoginMetrics python script produces a formatted report showing the total numbers of logins for the past 30 days by campus and by whether the login was on a mobile device or on a web browser. .. figure:: https://i.tpsdb.com/loginmetrics.jpg :target: # Sample LoginMetrics Report .. note:: This article describes the python script needed by a church that has multiple campuses. If you do not use the Campus feature of TouchPoint, see :doc:`LoginMetricsNC`. Create the LoginMetrics Script ------------------------------- Step 1 Go to `Administration > Setup > Special Content` and select the `Python Scripts` tab. Step 2 Click the green `+ New Python Script File` button and enter the name of the file as ``LoginMetrics`` and press `Submit`. Step 3 Copy all of the code below and then paste it into the new script file and press the blue `Save Python Script` button. .. literalinclude:: Files/LoginMetrics.py :linenos: Step 4 Modify the script with the campuses for your own church. Consult the list of campuses at Administration > Lookup Codes > Organizations: Campus. (Instead of "Campus" you may use a different label, as defined by the setting **CampusLabel**.) Replace the numbers on line 20 ``("1,2,3,4,5,6")`` with all the IDs for the campuses on your own database, separated by commas. Next, replace lines 14-19 with the descriptions and IDs for your campuses. You can add or remove lines, depending on whether you have more of fewer campuses than those listed in the sample code. The default reporting period is the past 30 days. If you need to change this, modify the numbers on lines 3, 10, and 20. (Depending on changes you have already made to the script, this final line may be something other than 20. You are looking to change the number in the text ``["Total (last 30 days)"``. For example, to modify the report to cover the past 60 days, change the ``30`` in these lines to ``60``. Step 5 Click the `Run Script` button at the top of the form. Then, if you want the report available on the Reports Menu, click the link at the bottom of the report - `Add Report to Menu`. | | +--------------------+------------------+ | **Latest Update** | **11/13/2020** | +--------------------+------------------+ Modify image link with secure protocol.