Skip to content

Commit

Permalink
lowered nof trackers showed + added fathom tracking support
Browse files Browse the repository at this point in the history
issue #101
  • Loading branch information
7h3Rabbit committed Feb 5, 2022
1 parent 157d335 commit e98d42f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/regression-test-har.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ jobs:
python default.py -t 23 -r -u https://skatteverket.se/ -o .github/workflows/testresult-23.json
python .github/workflows/verify_result.py -t 23
if: ${{ success() }}
- name: Test Tracking and Privacy - https://nimbleinitiatives.com/
run: |
python default.py -t 23 -r -u https://nimbleinitiatives.com/ -o .github/workflows/testresult-23.json
python .github/workflows/verify_result.py -t 23
if: ${{ success() }}
# - name: Content - https://skatteverket.se/
# run: cat results/pages/skatteverket_se/data/browsertime.har
# if: ${{ success() }}
Expand Down
28 changes: 25 additions & 3 deletions tests/tracking_validator_pagexray.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,13 +497,13 @@ def rate_tracking(website_urls, _local, _):

url_rating = Rating(_, review_show_improvements_only)
if url_is_tracker:
if number_of_tracking <= 20:
if number_of_tracking <= 5:
url_rating.set_integrity_and_security(
1.0, ' - Request #{0} - Tracking found'.format(request_index))
url_rating.set_overall(1.0)
elif number_of_tracking == 21:
elif number_of_tracking == 6:
url_rating.set_integrity_and_security(
1.0, ' - More then 20 requests found, filtering out the rest'.format(request_index))
1.0, ' - More then 5 requests found, filtering out the rest'.format(request_index))
url_rating.set_overall(1.0)
else:
url_rating.set_integrity_and_security(1.0)
Expand Down Expand Up @@ -875,6 +875,28 @@ def has_matomo(json_content):
return False


def has_fathom(json_content):
# Look for javascript objects
if 'window.fathom' in json_content:
return True
if 'locationchangefathom' in json_content:
return True
if 'blockFathomTracking' in json_content:
return True
if 'fathomScript' in json_content:
return True

# Look for file names
if 'cdn.usefathom.com' in json_content:
return True
if 'google-analytics.com/analytics.js' in json_content:
return True
if 'google-analytics.com/ga.js' in json_content:
return True

return False


def has_matomo_tagmanager(json_content):
# Look for javascript objects
if 'window.MatomoT' in json_content:
Expand Down

0 comments on commit e98d42f

Please sign in to comment.