Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 18, 2025

📚 Description

Added an optional altText parameter to allow customization of the alt attribute for the tracking pixel image in the noscript fallback.

By default, the alt attribute remains empty (preserving the original behavior). Customers can now optionally provide their own alt text for accessibility or other requirements.

🔗 Linked issue(s)

Fixes # (issue)

❓ Type of change

  • ✨ New feature (a non-breaking change that adds functionality)

📄 Changelog

  • Added optional altText parameter to SimpleAnalytics component props in src/SimpleAnalytics.astro
  • Added sanitization for altText using existing sanitizeString utility
  • Updated tracking pixel image to use dynamic alt attribute: alt={sanitizedAltText || ""}
  • Updated README.md to include altText in configuration reference
  • Updated FEATURES.md with new documentation section explaining the altText option
  • Added table of contents entry in FEATURES.md for the new option

Default behavior (no altText provided):

<img
  src={imageSrc}
  alt=""
  referrerpolicy="no-referrer-when-downgrade"
/>

Custom behavior (with altText):

<SimpleAnalytics altText="Simple Analytics tracking pixel" />

Results in:

<img
  src={imageSrc}
  alt="Simple Analytics tracking pixel"
  referrerpolicy="no-referrer-when-downgrade"
/>

✅ Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have manually tested the newly added functionality with no discernable errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
Original prompt

However, it seems the tracking pixel that this library integrates, misses an alt-tag.

Would it be possible to update the library to add an alt-tag to tracking pixel?


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits November 18, 2025 12:57
Co-authored-by: adriaandotcom <1079135+adriaandotcom@users.noreply.github.com>
Co-authored-by: adriaandotcom <1079135+adriaandotcom@users.noreply.github.com>
Copilot AI changed the title [WIP] Update library to add alt-tag for tracking pixel fix: add alt attribute to tracking pixel image Nov 18, 2025
Copilot AI requested a review from adriaandotcom November 18, 2025 13:06
@adriaandotcom
Copy link
Contributor

@copilot make it optional with a setting where customers can fill in their own alt text. for others, keep it empty.

Co-authored-by: adriaandotcom <1079135+adriaandotcom@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 18, 2025

@copilot make it optional with a setting where customers can fill in their own alt text. for others, keep it empty.

Done! Added optional altText parameter. Default behavior keeps it empty. Customers can now provide custom alt text like <SimpleAnalytics altText="your custom text" />. Commit: d8867af

Copilot AI changed the title fix: add alt attribute to tracking pixel image feat: add optional altText parameter for tracking pixel Nov 18, 2025
@adriaandotcom adriaandotcom marked this pull request as ready for review November 18, 2025 16:12
@adriaandotcom adriaandotcom merged commit 435532d into main Nov 18, 2025
@adriaandotcom adriaandotcom deleted the copilot/add-alt-tag-to-tracking-pixel branch November 18, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants