@visual-framework/vf-analytics-google
Advanced tools
Comparing version 1.0.0-rc.6 to 1.0.0-rc.8
@@ -0,1 +1,5 @@ | ||
### 1.0.0-rc.7 | ||
* Add label to the list of ancestors to look for | ||
### 1.0.0-rc.6 | ||
@@ -10,3 +14,3 @@ | ||
* `vfGaIndicateLoaded()` now accepts the options object `vfGaTrackOptions` | ||
* with property `vfGaTrackPageLoad`. `vfGaTrackOptions.vfGaTrackPageLoad` defaults to true. If you set to false, the function will _not_ track the initial page view. Useful if you track the initial page view with JavaScript in your HTML. | ||
* with property `vfGaTrackPageLoad`. `vfGaTrackOptions.vfGaTrackPageLoad` defaults to true. If you set to false, the function will _not_ track the initial page view. Useful if you track the initial page view with JavaScript in your HTML | ||
* https://github.com/visual-framework/vf-core/issues/1116 | ||
@@ -45,3 +49,3 @@ * Track the users network: `vfGaTrackOptions.vfGaTrackNetwork`. As of February 2020 Google Analytics no longer tracks the network name of visitors. A 3rd party tool enables this, follow the setup guide at https://ipmeta.io/instructions (note there is no need to load https://ipmeta.io/plugin.js, this component includes it for you) | ||
* fixes typo `data-vf-google-analytics-region` from `data-vf-google-anlaytics-region` | ||
* 🚨 this may be breaking for some users of alpha.1 | ||
* this may be breaking for some users of alpha.1 | ||
* extend scope to more than "a" tags | ||
@@ -48,0 +52,0 @@ * better detect areas where the event is fired |
{ | ||
"version": "1.0.0-rc.6", | ||
"version": "1.0.0-rc.8", | ||
"name": "@visual-framework/vf-analytics-google", | ||
@@ -23,3 +23,3 @@ "description": "vf-analytics-google component", | ||
], | ||
"gitHead": "bc7aae5f4d394bb907d39e4adfb471da248de474" | ||
"gitHead": "a7b32d1741cbc522ddfd97a9d21615bd9069c5c9" | ||
} |
@@ -1,9 +0,9 @@ | ||
# Google Analytics enhancements component | ||
# Google Analytics Enhancements component | ||
[![npm version](https://badge.fury.io/js/%40visual-framework%2Fvf-analytics-google.svg)](https://badge.fury.io/js/%40visual-framework%2Fvf-analytics-google) | ||
## About | ||
Supplementary behaviour (primarily JavaScript) to ease tracking with Google Analytics. | ||
This component will grow over time with additional event tracking behaviours. | ||
## Usage | ||
@@ -116,3 +116,3 @@ | ||
This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `vf-analytics-google` with this command. | ||
This repository is distributed with [npm](https://www.npmjs.com/). After [installing npm](https://nodejs.org/), you can install `vf-analytics-google` with this command. | ||
@@ -123,4 +123,10 @@ ``` | ||
### Sass/CSS installation | ||
### Sass/CSS | ||
- There is currently no Sass/css needed for this component. | ||
## Help | ||
- [Read the Visual Framework troubleshooting](https://visual-framework.github.io/vf-welcome/troubleshooting/) | ||
- [Open a ticket](https://github.com/visual-framework/vf-core/issues) | ||
- [Chat on Slack](https://join.slack.com/t/visual-framework/shared_invite/enQtNDAxNzY0NDg4NTY0LWFhMjEwNGY3ZTk3NWYxNWVjOWQ1ZWE4YjViZmY1YjBkMDQxMTNlNjQ0N2ZiMTQ1ZTZiMGM4NjU5Y2E0MjM3ZGQ) |
@@ -221,16 +221,14 @@ // vf-analytics-google | ||
// sometimes a `span` or `img` element is wrapped in an `a` element | ||
var from = findParent("a", evt.target || evt.srcElement); | ||
if (from) { | ||
// console.log('clicked from findParent: ',from); | ||
vfGaTrackInteraction(from); | ||
return; | ||
// In the case that elements such as `span` are wrapped in action elements (e.g. `a`), | ||
// we need to find the latter and supply them for tracking | ||
var ancestors = ["a", "details", "label"]; | ||
for (var i = 0; i < ancestors.length; i++) { | ||
var from = findParent(ancestors[i], evt.target || evt.srcElement); | ||
if (from) { | ||
vfGaTrackInteraction(from); | ||
return; | ||
} | ||
} | ||
// similarly for a `details` element | ||
from = findParent("detail", evt.target || evt.srcElement); | ||
if (from) { | ||
// console.log('clicked from findParent: ',from); | ||
vfGaTrackInteraction(from); | ||
return; | ||
} | ||
}, false ); | ||
@@ -237,0 +235,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
45762
131
493