Skip to content

Commit 435532d

Browse files
Merge pull request #2 from simpleanalytics/copilot/add-alt-tag-to-tracking-pixel
feat: add optional altText parameter for tracking pixel
2 parents 6725f1a + d8867af commit 435532d

File tree

4 files changed

+5620
-4408
lines changed

4 files changed

+5620
-4408
lines changed

FEATURES.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- [✅ Option: Strict UTMs 🔒](https://github.com/ViorelMocanu/astro-simpleanalytics-plugin/blob/main/FEATURES.md#user-content--option-strict-utms-)
1515
- [✅ Option: Allow URL parameters 🔓](https://github.com/ViorelMocanu/astro-simpleanalytics-plugin/blob/main/FEATURES.md#user-content--option-allow-url-parameters-)
1616
- [✅ Option: Ignore metrics 🚫](https://github.com/ViorelMocanu/astro-simpleanalytics-plugin/blob/main/FEATURES.md#user-content--option-ignore-metrics-)
17+
- [✅ Option: Custom alt text for tracking pixel 🏷️](https://github.com/ViorelMocanu/astro-simpleanalytics-plugin/blob/main/FEATURES.md#user-content--option-custom-alt-text-for-tracking-pixel-️)
1718
- [💡 Feature: Embed chart on your site 📈](https://github.com/ViorelMocanu/astro-simpleanalytics-plugin/blob/main/FEATURES.md#user-content--feature-embed-chart-on-your-site-)
1819

1920
Once you [install it](README.md#🚀-installation), the Astro Simple Analytics Plugin should be ready to go with zero config.
@@ -40,6 +41,7 @@ These are all the available parameter options for this plugin where you choose t
4041
ignorePages={undefined} {/* (undefined | string) */}
4142
nonUniqueHostnames={undefined} {/* (undefined | string) */}
4243
ignoreMetrics={undefined} {/* (undefined | string) */}
44+
altText={undefined} {/* (undefined | string) */}
4345
/>
4446
```
4547

@@ -250,6 +252,18 @@ So if, for example, you'd like to ignore `timeonpage` and `scrolled`, you should
250252

251253
You can add any number of metrics to this list if you want to ignore them.
252254

255+
## ✅ Option: Custom alt text for tracking pixel 🏷️
256+
257+
By default, the tracking pixel in the noscript fallback has an empty alt attribute (`alt=""`), which is appropriate for decorative images. However, you may want to provide custom alternative text for accessibility or other reasons.
258+
259+
You can customize the alt text by passing the `altText` parameter:
260+
261+
```Astro
262+
<SimpleAnalytics altText="Simple Analytics tracking pixel" />
263+
```
264+
265+
If you don't provide the `altText` parameter, it will default to an empty string, keeping the original behavior.
266+
253267
## 💡 Feature: Embed chart on your site 📈
254268

255269
The Astro Simple Analytics Plugin allows you to [embed a chart of your public website statistics](https://docs.simpleanalytics.com/embed-chart-on-your-site) on your website.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ These are all the available parameter options for this plugin where you choose t
7575
ignorePages={undefined} {/* (undefined | string) */}
7676
nonUniqueHostnames={undefined} {/* (undefined | string) */}
7777
ignoreMetrics={undefined} {/* (undefined | string) */}
78+
altText={undefined} {/* (undefined | string) */}
7879
/>
7980
```
8081

0 commit comments

Comments
 (0)