Skip to content

Commit 3365ba0

Browse files
committed
Renamed field "Package destination" to "Package source"
1 parent e574ae2 commit 3365ba0

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99
### Added
10-
- Added new field "Package destination" in the GTM template that allows to specify the location of the package files.
11-
- Added section "About the package destination" in the README.
10+
- Added new field "Package source" in the GTM template that allows to specify the location of the package files.
11+
- Added section "Using other CDN or self-hosted" in the README.
1212

1313
## [1.3.0] - 2025-04-03
1414
### Added

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ An extended integration of [orestbida/cookieconsent](https://github.com/orestbid
1616

1717
* [Integration into the GTM](#integration-into-the-gtm)
1818
* [Configuration](#configuration)
19-
* [About the package destination](#about-the-package-destination)
19+
* [Using other CDN or self-hosted](#using-other-cdn-or-self-hosted)
2020
* [Settings modal trigger](#settings-modal-trigger)
2121
* [Triggering tags based on the consent](#triggering-tags-based-on-the-consent)
2222
* [Accessing the wrapper in the JavaScript](#accessing-the-wrapper-in-the-javascript)
@@ -54,7 +54,7 @@ The plugin is configurable using fields inside the tag definition.
5454
| Field | Description |
5555
|-------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
5656
| Package version | Version of the package `68publishers/cookie-consent`. Valid inputs are the `latest` or a version in formats `x.x.x`, `x.x.x-beta.x` and `x.x.x-alpha-x`. For available versions see the [releases](https://github.com/68publishers/cookie-consent/releases). |
57-
| Package destination | The URL where the package files are hosted. If the field is not filled, the **unpkg.com** CDN is used. To use a different CDN or self-hosting, please read the [About the package destination](#about-the-package-destination) section |
57+
| Package source | The URL where the package files are hosted. If the field is not filled, the **unpkg.com** CDN is used. To use a different source, please read the [Using other CDN or self-hosted](#using-other-CDN-or-self-hosted) |
5858
| Make consent required | The page will be blocked until a user action. |
5959
| Show the widget as soon as possible | The widget will be displayed automatically on the page load. You must trigger the widget manually by calling `CookieConsentWrapper.unwrap().show()` if the option is disabled. |
6060
| Init widget after DOMContentLoaded | The widget is initialized as soon as possible by default. If the option is enabled, initialization will wait until the `DOMContentLoaded` event. |
@@ -204,26 +204,26 @@ Managing page scripts is disabled by default. When the feature is enabled then t
204204
</script>
205205
```
206206

207-
## About the package destination
207+
## Using other CDN or self-hosted
208208

209-
The configuration gives the option to set the URL from which the package files (js, css and translation files) will be loaded via the `Package destination` field.
209+
The configuration gives the option to set the URL from which the package files (js, css and translation files) will be loaded via the `Package source` field.
210210

211211
If the field is left blank, the `unpkg.com` CDN is used. Alternatively, `jsDelivr.com` can be used by entering the following URL:
212212
```
213213
https://cdn.jsdelivr.net/npm/@68publishers/cookie-consent@{version}/dist/
214214
```
215215
The `{version}` placeholder is automatically replaced with the value from the `Package version` field.
216216

217-
### Self-hosted package files
217+
### Self-hosted package
218218

219219
It is possible to host package files at any URL. To do this, the following steps are required:
220220

221-
- The complete contents of the [dist](./dist) folder must be accessible from that URL.
222-
- The "Package destination" field needs to be set correctly.
223-
- It is necessary to modify the "Inject script" permissions in the GTM template.
221+
1. The complete contents of the [dist](./dist) folder must be accessible from that URL.
222+
2. The "Package source" field needs to be set correctly.
223+
3. It is necessary to modify the "Inject script" permissions in the GTM template.
224224

225-
For example, if the package files are available at the URL https://www.example.com/static/cookie-consent/, the `Package destination` field needs to be set to `https://www.example.com/static/cookie-consent/`.
226-
Of course, the placeholder `{version}` can also be used in the field.
225+
For example, if the package files are available at the URL https://www.example.com/static/cookie-consent/, the `Package source` field needs to be set to `https://www.example.com/static/cookie-consent/`.
226+
Also, the placeholder `{version}` can be used in the field.
227227

228228
Next, the GTM template needs to be modified. In the "Permissions" tab, it is necessary to add the URL `https://www.example.com/` in the "Inject scripts" section.
229229

@@ -430,13 +430,13 @@ Below this field you can define which columns the cookie table should contain.
430430

431431
## How to update already published containers
432432

433-
If you want to update to the newer version please firstly look into [releases](https://github.com/68publishers/cookie-consent/releases) to see what has changed until the release that you using.
433+
If you want to update to the newer version please firstly look into [releases](https://github.com/68publishers/cookie-consent/releases) to see what has changed until the release that you are using.
434434

435435
For update, you must reimport the Template in your GTM in the same way how you imported it for the first time. The template will be updated but existing configurations inside tags will be kept. Of course, if the Template wasn't changed between releases then you can skip this step.
436436

437437
Then open the associated tag and update the value of the field `Package version`.
438438

439-
If the package files are [self-hosted](#self-hosted-package-files), it is necessary to re-edit the template permissions.
439+
If the package files are [self-hosted](#self-hosted-package), it is necessary to re-edit the Injects scripts in template permissions.
440440

441441
### Migration from v0.4 to v0.5
442442

gtm_template.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ ___TEMPLATE_PARAMETERS___
4747
},
4848
{
4949
"type": "TEXT",
50-
"name": "package_destination",
51-
"displayName": "Package destination",
50+
"name": "package_source",
51+
"displayName": "Package source",
5252
"simpleValueType": true,
5353
"help": "The URL where the package files are hosted. If the field is not filled , the \u003cstrong\u003eunpkg.com\u003c/strong\u003e CDN is used. To use a different CDN or self-hosting, the field value needs to be set to the URL that leads to the package root (dist folder in the repository). The variable \u003cem\u003e{version}\u003c/em\u003e can be used, which will be replaced by the value from the \u003cem\u003e\"Package version\"\u003c/em\u003e field."
5454
},
@@ -2415,7 +2415,7 @@ setInWindow('cc_wrapper_config', {
24152415
}, true);
24162416

24172417
// inject cookie consent wrapper
2418-
let scriptBaseUrl = data.package_destination ? data.package_destination : 'https://unpkg.com/@68publishers/cookie-consent@{version}/dist/';
2418+
let scriptBaseUrl = data.package_source ? data.package_source : 'https://unpkg.com/@68publishers/cookie-consent@{version}/dist/';
24192419
scriptBaseUrl = scriptBaseUrl.replace('{version}', data.package_version);
24202420

24212421
if (scriptBaseUrl.indexOf('/', scriptBaseUrl.length - 1) < 0) {

0 commit comments

Comments
 (0)