Skip to content

Commit 7687978

Browse files
authored
Merge pull request #42 from Oksydan/partytown
Partytown feature
2 parents 580f0dd + a061d95 commit 7687978

File tree

20 files changed

+3409
-8
lines changed

20 files changed

+3409
-8
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ node_modules/
1414
!/vendor/composer/index.php
1515

1616
### Assets ###
17-
/views/dist/
18-
!/views/dist/index.php
17+
/public/
1918

2019
### Tests ###
2120
.php-cs-fixer.cache

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
build-module-zip: build-composer build-zip
1+
build-module-zip: build-composer build-assets build-zip
22

33
build-zip:
44
rm -rf is_themecore.zip
55
cp -Ra $(PWD) /tmp/is_themecore
66
rm -rf /tmp/is_themecore/config_*.xml
77
rm -rf /tmp/is_themecore/_theme_dev/node_modules
8+
rm -rf /tmp/is_themecore/_module_dev/node_modules
89
rm -rf /tmp/is_themecore/.github
910
rm -rf /tmp/is_themecore/.gitignore
1011
rm -rf /tmp/is_themecore/.php-cs-fixer.cache
@@ -16,3 +17,5 @@ build-zip:
1617
build-composer:
1718
composer install --no-dev -o
1819

20+
build-assets:
21+
cd _module_dev && npm install && npm run build

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,29 @@ You are able to modify structured data with hooks. List of hooks:
6868
Every hook $param is an array with two keys:
6969
- `$data` - reference of structured data array
7070
- `$rawData` - raw structured data array (provided by data provider)
71+
72+
#### Partytown
73+
74+
You are able to use [partytown](https://partytown.builder.io/) with this module. You have to enable it first in module configuration.
75+
Example of usage for GTAG:
76+
77+
```html
78+
<script>
79+
window.partytown.forward.push('datalayer.push');
80+
window.partytown.forward.push('gtag');
81+
</script>
82+
<script type="text/partytown" src="https://www.googletagmanager.com/gtag/js?id=YOUR_GTAG_CODE"></script>
83+
<script type="text/partytown">
84+
dataLayer = window.dataLayer || [];
85+
window.gtag = function () {
86+
dataLayer.push(arguments);
87+
};
88+
89+
window.gtag('js', new Date());
90+
91+
window.gtag('config', 'YOUR_GTAG_CODE');
92+
</script>
93+
```
94+
95+
##### Beware that partytown is still in beta, and it may not work as expected. Make sure to test it before using in production.
96+

_module_dev/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18.12.1

0 commit comments

Comments
 (0)