@aranova/tracking-browser 0.17.0 → 0.17.2

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
@@ -107,6 +107,33 @@ The browser package validates manual events at runtime. If an event is not regis
107
107
 
108
108
  `fields[].value` can be any JSON value: string, number, boolean, null, array, or object. Only send reviewed, allowlisted, non-sensitive values; do not send names, emails, phone numbers entered by the visitor, addresses, payment data, medical details, passwords, file contents, or free-text messages.
109
109
 
110
+ ### Phone clicks (`tel:` taps) — manual or auto-capture
111
+
112
+ Opt into **auto-capture** and every `tel:` link is tracked with no per-link code — add
113
+ `autoCapture` to the `phone_click` registration in `init()`:
114
+
115
+ ```js
116
+ manual: {
117
+ phone_click: { autoCapture: {} }, // default selector: a[href^="tel:"]
118
+ // or narrow it: { autoCapture: { selector: "a.call" } }
119
+ },
120
+ ```
121
+
122
+ Then use ordinary phone links — a single delegated listener does the rest:
123
+
124
+ ```html
125
+ <a href="tel:+14165550199" data-aranova-section="header">(416) 555-0199</a>
126
+ ```
127
+
128
+ The number is read from the `href` (normalized to E.164); `section` comes from an optional
129
+ `data-aranova-section`. **Unlike `cta_click`, a `phone_click` also fires the Google Ads
130
+ conversion** for a linked phone-call goal (a `CLICK_TO_CALL` action) — auto-fired the moment the
131
+ tap is captured, so you never call `trackConversion`. (Firing needs `conversionConfig` wired; see
132
+ below.)
133
+
134
+ Prefer to instrument links yourself? Fire it per element instead — this fires the conversion the
135
+ same way:
136
+
110
137
  ```html
111
138
  <a
112
139
  href="tel:+14165550199"
@@ -115,9 +142,8 @@ The browser package validates manual events at runtime. If an event is not regis
115
142
  page: { path: window.location.pathname },
116
143
  section: 'header'
117
144
  })"
145
+ >(416) 555-0199</a
118
146
  >
119
- (416) 555-0199
120
- </a>
121
147
  ```
122
148
 
123
149
  ### CTA clicks — manual or auto-capture