Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iqual-ch/iq_geo_tracking
Drupal module to track visitors from a certain geographic region in the front-end
https://github.com/iqual-ch/iq_geo_tracking
Last synced: about 1 month ago
JSON representation
Drupal module to track visitors from a certain geographic region in the front-end
- Host: GitHub
- URL: https://github.com/iqual-ch/iq_geo_tracking
- Owner: iqual-ch
- Created: 2020-10-07T09:31:49.000Z (over 4 years ago)
- Default Branch: 2.x
- Last Pushed: 2022-07-14T10:41:04.000Z (over 2 years ago)
- Last Synced: 2023-03-11T20:17:52.068Z (almost 2 years ago)
- Language: PHP
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# iqual Geo Tracking Module
This module adds the capability to only track visitors from a certain geographic location (Switzerland) with the Google Tag Manager. It sets a cookie (`iq_gt`) and fires a dataLayer event (`iq_gt_allowed`) when a trackable user is first identified.
## Dependecies
* `smart_ip` (for IP geo lookup)
* `google_tag` (or similiar for GTM integration)## Installation
1. Setup the [smart_ip module](https://www.drupal.org/project/smart_ip)
* Install an IP datasource (e.g. MaxMind GeoIP2 Lite Country database)
* Roles to Geolocate: anonymous and authenticated users
* Acquire/update user's geolocation on specific Drupal native pages: `/tracking/check`
2. Install this module
3. Enable the `/tracking/check:GET` REST endpoint and allow access for anonymous visitors as well as authenticated users (in `/admin/config/services/rest`).
4. Setup the Google Tag Manager container to support the new functionality## Google Tag Manager Setup
1. Create a first-party cookie variable for the cookie name `iq_gt`
2. Create a custom event trigger for the event name `iq_gt_allowed`
3. Add the first-party cookie to existing triggers as a condition so that the trigger is only fired if the cookie value matches `1`. Apply this to all triggers that are only allowed to fire for trackable visitors. (e.g. PDF link clicks)
3. Add the custom event trigger to existing tags that only fire once per page visit. (e.g. Google Analytics pageview)