Skip to content

Leave phone click navigation to the website and browser - #111

Merged
adriaandotcom merged 1 commit into
v12from
fix/v12-phone-click-navigation
Oct 15, 2026
Merged

adriaandotcom merged 1 commit into
v12from
fix/v12-phone-click-navigation

Conversation

@simple-analytics-ai

Copy link
Copy Markdown

Base: #40 (v12). Merge this into v12 before releasing #40 to main.

Summary

Fixes #107

Keep collecting phone clicks while leaving telephone-link navigation to the browser and the website's click handler. The analytics callback no longer assigns document.location for phone events, including when the click was cancelled.

Requested in compatibility review item 5. Omitting data-collect still enables outbound, email, download, and phone collection. Existing explicit selections and other link types keep their behavior.

Security implications

  • No security impact
  • Has security impact - described as: prevents analytics from triggering a telephone navigation that the website cancelled; the existing phone collection default is retained as requested.

Testing

  • Rebuilt distributions; 17 unit tests passed, including automatic default phone collection with a cancelled click and a completed analytics callback.
  • Prettier and git diff --check passed.
  • Minified auto-events.js: +13 bytes; gzip +2 bytes, excluding generated headers. Main tracker unchanged.
  • Current main refreshed through the broker and already included in this branch.
  • BrowserStack not run locally.

Checklist

  • Linked to an issue
  • Tested
  • Asked for a review

Requested in item 5: prevent unwanted telephone navigation from analytics callbacks while retaining default outbound, email, download, and phone collection when data-collect is omitted.

Refs #107
Comment thread test/unit/auto-events.test.js
@github-actions

Copy link
Copy Markdown

Documentation update

_docs/55_events/05_automated-events.md

Location: New ## Phones section directly after the ## Downloads section, and the data-collect value in the settings example under ## Script

Copy and paste this into the documentation repository:

## Phones

Do you have `tel:` links on your website? Then you can see how many clicks you get on your phone number links. Phone clicks are collected by default and the script leaves the navigation itself to the browser and to your own click handlers, so a click your website cancels will not start a phone call.

<!-- prettier-ignore -->
```html
<script async src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
<script
  async
  data-collect="outbound,emails,downloads,phones"
  data-extensions="pdf,csv,docx,xlsx,zip,doc,xls"
  data-use-title="true"
  data-full-urls="false"
  src="https://scripts.simpleanalyticscdn.com/auto-events.js"></script>

The `data-collect` default in the existing `## Script` example is missing `phones`, and the intro paragraph lists only outbound links, email clicks, and downloads.

@github-actions

Copy link
Copy Markdown
Claude review checkpoint

Reviewed commit 2a904342d98569211ce737a5102f026487ae0ebe. This is used to keep later automated reviews focused on changes Claude has not checked yet.

@github-actions github-actions Bot added the change: routine Changes to internal tools or low-risk changes (e.g., design updates or content modifications) label Oct 15, 2026
@github-actions

Copy link
Copy Markdown

SDLC label: change: routine because Bug fix in the auto-events tracking script that stops forcing a duplicate navigation on tel: link clicks; phone event collection, data handling, permissions, billing, and infrastructure are unchanged

@simple-analytics-ai

Copy link
Copy Markdown
Author

In response to #111 (comment):

Prepared a patch against current docs/master adding the Phones section, correcting the default data-collect list, and describing native phone-link navigation. Verified phones are enabled by default and the v12 fix leaves navigation to the browser and site handlers.

The patch applies cleanly. There is no matching open docs PR to update. I have requested owner approval for a supporting docs PR because this automation is authorized to push to existing PR branches. Publication of these instructions must follow the relevant script PR and the v12 release; the patch remains local pending that approval.

@adriaandotcom
adriaandotcom merged commit b568ca3 into v12 Oct 15, 2026
7 of 8 checks passed
@adriaandotcom
adriaandotcom deleted the fix/v12-phone-click-navigation branch October 15, 2026 14:33
simple-analytics-ai Bot pushed a commit that referenced this pull request Oct 15, 2026
Requested: rebuild the distributions after PR #108 and verify that manual queries override browser parameters, absent manual queries fall back to location.search, and existing filtering remains effective. Include the newly merged phone-click fix from #111 and preserve current inline events.

Regenerate only the 29 affected bundles and source maps. All 39 unit tests and 24 additional payload checks pass on the pinned toolchain.

Refs #107
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change: routine Changes to internal tools or low-risk changes (e.g., design updates or content modifications)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant