@affiliateo/web 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -171,12 +171,12 @@ attributes become metadata (kebab-case → snake_case, up to 10 params).
171
171
  </section>
172
172
  ```
173
173
 
174
- Fires once when 10% of the section enters the viewport (combined with a
175
- small bottom-edge rootMargin so it doesn't fire on sections barely peeking
176
- up from the bottom of the screen). The lower threshold catches tall
177
- sections like pricing pages with comparison tables that would otherwise
178
- top out under 50% intersection and never fire. Great for landing pages
179
- where you want to know which sections convert.
174
+ Fires the first time any pixel of the section overlaps the viewport.
175
+ Maximum permissiveness — if the user scrolled enough to see even a sliver,
176
+ it counts. Earlier versions required 50% visibility, which was unreachable
177
+ for tall sections (a pricing page with comparison tables silently dropped
178
+ out of every funnel). Great for landing pages where you want to know
179
+ which sections convert.
180
180
 
181
181
  ### Goal naming rules
182
182
 
package/dist/provider.js CHANGED
@@ -332,22 +332,16 @@ export function AffiliateoProvider({ campaignId, apiUrl, children, }) {
332
332
  // path) and unobserve after the first fire so the same element can't
333
333
  // double-count if the user scrolls back up.
334
334
  //
335
- // Threshold: 0.1 (was 0.5). 50% visibility is unreachable for tall
336
- // sections — a 1600px pricing section in an 800px viewport tops out
337
- // at ~50% intersection ratio, so the observer's threshold was either
338
- // a bare miss (section maxes at 49%) or a brittle hit. Funnel steps
339
- // tied to those sections silently dropped from every merchant's
340
- // conversion count without anyone noticing the section was even
341
- // being rendered. 0.1 fires when 10% of the section is visible,
342
- // which on a typical laptop is "the user has scrolled enough that
343
- // the section is meaningfully on screen" without firing on sections
344
- // that barely peek up from the bottom edge.
345
- //
346
- // rootMargin: trim the bottom 10% of the viewport from the trigger
347
- // zone so a section creeping up from the very bottom of the screen
348
- // doesn't fire instantly. The user has to scroll enough that the
349
- // section is starting to settle into the main visible area, which
350
- // matches a human's intuitive sense of "I've reached that section."
335
+ // No options object → IntersectionObserver defaults to
336
+ // { threshold: 0, rootMargin: '0px 0px 0px 0px' }, which fires the
337
+ // instant ANY pixel of the section overlaps the viewport. That's
338
+ // exactly the semantic merchants want for "did the visitor reach
339
+ // this section": if they scrolled enough to see even a sliver of
340
+ // it, count it. Earlier versions used { threshold: 0.5 }, which
341
+ // was unreachable for tall sections (a 1600px pricing section in
342
+ // an 800px viewport tops out at ~50% intersection ratio and never
343
+ // crossed the threshold) — funnel steps tied to those sections
344
+ // silently dropped from every merchant's conversion count.
351
345
  const scrollFired = new WeakSet();
352
346
  let scrollObserver = null;
353
347
  let scrollMo = null;
@@ -364,7 +358,7 @@ export function AffiliateoProvider({ campaignId, apiUrl, children, }) {
364
358
  track(goal);
365
359
  scrollObserver?.unobserve(entry.target);
366
360
  }
367
- }, { threshold: 0.1, rootMargin: '0px 0px -10% 0px' });
361
+ });
368
362
  // Observe everything that exists at mount time.
369
363
  document.querySelectorAll('[data-affiliateo-scroll]').forEach((el) => {
370
364
  scrollObserver?.observe(el);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@affiliateo/web",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "Affiliateo web SDK — affiliate attribution and tracking for web apps",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",