Skip to content

Commit 6d0e79c

Browse files
authored
Merge pull request #423 from cultuurnet/feature/III-6528
III-6528 - Make snowplow collectorDomain dynamic based on environment
2 parents 9656e59 + ff9ea6e commit 6d0e79c

File tree

2 files changed

+43
-39
lines changed

2 files changed

+43
-39
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,40 @@ name: CI
33
on: push
44

55
jobs:
6-
build:
7-
8-
runs-on: ubuntu-latest
9-
strategy:
10-
matrix:
11-
php-versions: ['7.4']
12-
name: PHP ${{ matrix.php-versions }}
13-
steps:
14-
- uses: actions/checkout@v2
15-
16-
- name: Install PHP
17-
uses: shivammathur/setup-php@v2
18-
with:
19-
php-version: ${{ matrix.php-versions }}
20-
extensions: intl, bcmath
21-
tools: composer:v1
22-
23-
- name: Check PHP Version
24-
run: php -v
25-
26-
- name: Validate composer.json and composer.lock
27-
run: composer validate
28-
29-
- name: Cache Composer packages
30-
id: composer-cache
31-
uses: actions/cache@v2
32-
with:
33-
path: vendor
34-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
35-
restore-keys: |
36-
${{ runner.os }}-php-
37-
38-
- name: Install dependencies
39-
if: steps.composer-cache.outputs.cache-hit != 'true'
40-
run: composer install --no-progress --no-suggest
41-
42-
- name: Run CI checks
43-
run: composer ci
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
php-versions: ["7.4"]
11+
name: PHP ${{ matrix.php-versions }}
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install PHP
16+
uses: shivammathur/setup-php@v2
17+
with:
18+
php-version: ${{ matrix.php-versions }}
19+
extensions: intl, bcmath
20+
tools: composer:v1
21+
22+
- name: Check PHP Version
23+
run: php -v
24+
25+
- name: Validate composer.json and composer.lock
26+
run: composer validate
27+
28+
- name: Cache Composer packages
29+
id: composer-cache
30+
uses: actions/cache@v4
31+
with:
32+
path: vendor
33+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-php-
36+
37+
- name: Install dependencies
38+
if: steps.composer-cache.outputs.cache-hit != 'true'
39+
run: composer install --no-progress --no-suggest
40+
41+
- name: Run CI checks
42+
run: composer ci

web/assets/js/widgets/core/snowplow-tracking.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@
6464

6565
const environment = getEnvironment();
6666

67+
const collectorDomain =
68+
environment === "prod"
69+
? "sneeuwploeg.uitdatabank.be"
70+
: "sp-dev.uitdatabank.be";
71+
6772
const getTimeSpentInSeconds = () => {
6873
const endTime = new Date();
6974
return (endTime.getTime() - STARTTIME.getTime()) / 1000;
@@ -94,7 +99,7 @@
9499
window.widgetSnowplow(
95100
"newTracker",
96101
SNOWPLOW_TRACKER_NAME,
97-
"sneeuwploeg.uitdatabank.be",
102+
collectorDomain,
98103
{
99104
appId: "widgets",
100105
platform: "web",

0 commit comments

Comments
 (0)