Skip to content

Commit a2bef4b

Browse files
committed
feat: Initial Commit
Initial Commit
0 parents  commit a2bef4b

11 files changed

Lines changed: 160 additions & 0 deletions

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea
2+
**/*Zone.Identifier

Configuration/Settings.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
NextBox:
2+
Seo:
3+
MetaPixel:
4+
metaPixelId: ''
5+
6+
Neos:
7+
Neos:
8+
fusion:
9+
autoInclude:
10+
'NextBox.Seo.MetaPixel': true
11+
userInterface:
12+
translation:
13+
autoInclude:
14+
'NextBox.Seo.MetaPixel':
15+
- 'NodeTypes/*'

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Enes Erk
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'NextBox.Seo.MetaPixel:Mixin.MetaPixelConfig':
2+
abstract: true
3+
ui:
4+
inspector:
5+
groups:
6+
seoMetaPixel:
7+
label: i18n
8+
icon: fab fa-facebook
9+
position: 'end'
10+
properties:
11+
metaPixelId:
12+
type: string
13+
defaultValue: ''
14+
ui:
15+
label: i18n
16+
inspector:
17+
group: seoMetaPixel
18+
position: 10

ReadMe.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# NextBox.Seo.MetaPixel
2+
3+
> A package to integrate [Meta-Pixel](https://www.facebook.com/business/tools/meta-pixel) into Neos.
4+
5+
## Authors & Sponsors
6+
7+
Enes Erk - enes.erk@nextbox.dev
8+
9+
## Installation
10+
11+
```
12+
composer require nextbox/neos-seo-meta-pixel
13+
```
14+
15+
## Configuration
16+
17+
Configure the tracking-id in Settings.yaml:
18+
19+
```yaml
20+
NextBox:
21+
Seo:
22+
MetaPixel:
23+
metaPixelId: ''
24+
```
25+
26+
Or add the mixin to your root page:
27+
28+
```yaml
29+
'Foo.Bar:RootPage':
30+
superTypes:
31+
'NextBox.Seo.MetaPixel:Mixin.MetaPixelConfig': true
32+
```
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
prototype(Neos.Neos:Page) {
2+
seoMetaPixel = Neos.Fusion:Value {
3+
metaPixelId = ${!String.isBlank(q(site).property('metaPixelId')) ? q(site).property('metaPixelId') : Configuration.setting('NextBox.Seo.MetaPixel.metaPixelId')}
4+
5+
value = ${"<!-- Meta Pixel Code -->
6+
<script>
7+
!function(f,b,e,v,n,t,s)
8+
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
9+
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
10+
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
11+
n.queue=[];t=b.createElement(e);t.async=!0;
12+
t.src=v;s=b.getElementsByTagName(e)[0];
13+
s.parentNode.insertBefore(t,s)}(window, document,'script',
14+
'https://connect.facebook.net/en_US/fbevents.js');
15+
fbq('init', '" + this.metaPixelId + "');
16+
fbq('track', 'PageView');
17+
</script>
18+
<noscript><img height='1' width='1' style='display:none'
19+
src='https://www.facebook.com/tr?id=" + this.metaPixelId + "&ev=PageView&noscript=1'
20+
/></noscript>
21+
<!-- End Meta Pixel Code -->"}
22+
23+
@if.enable = ${!String.isBlank(this.metaPixelId)}
24+
@if.notInBackend = ${!site.context.inBackend}
25+
@position = 'before head'
26+
}
27+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include: **/*.fusion
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
3+
<file original="" product-name="NextBox.Seo.MetaPixel" source-language="en" target-language="de" datatype="plaintext">
4+
<body>
5+
<trans-unit id="properties.metaPixelId">
6+
<source>Tracking-ID</source>
7+
<target state="final">Tracking-ID</target>
8+
</trans-unit>
9+
<trans-unit id="groups.seoMetaPixel">
10+
<source>Meta Pixel (SEO)</source>
11+
<target state="final">Meta Pixel (SEO)</target>
12+
</trans-unit>
13+
</body>
14+
</file>
15+
</xliff>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
3+
<file original="" product-name="NextBox.Seo.MetaPixel" source-language="en" datatype="plaintext">
4+
<body>
5+
<trans-unit id="properties.metaPixelId">
6+
<source>Tracking-ID</source>
7+
</trans-unit>
8+
<trans-unit id="groups.seoMetaPixel">
9+
<source>Meta Pixel (SEO)</source>
10+
</trans-unit>
11+
</body>
12+
</file>
13+
</xliff>

0 commit comments

Comments
 (0)