mirror of
https://github.com/digitalocean/nginxconfig.io.git
synced 2025-08-11 14:34:06 +08:00
Only use analytics.js, not gtag.js
This commit is contained in:
@@ -167,7 +167,7 @@ THE SOFTWARE.
|
||||
importData(query, this.$data.domains, this.$data.global, this.$nextTick);
|
||||
|
||||
// Send an initial GA event for column mode
|
||||
this.splitColumnEvent();
|
||||
this.splitColumnEvent(true);
|
||||
},
|
||||
methods: {
|
||||
changes(index) {
|
||||
@@ -261,8 +261,8 @@ THE SOFTWARE.
|
||||
this.$data.splitColumn = !this.$data.splitColumn;
|
||||
this.splitColumnEvent();
|
||||
},
|
||||
splitColumnEvent() {
|
||||
analytics('toggle_split_column', 'Button', undefined, Number(this.$data.splitColumn));
|
||||
splitColumnEvent(nonInteraction = false) {
|
||||
analytics('toggle_split_column', 'Button', undefined, Number(this.$data.splitColumn), nonInteraction);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@@ -24,16 +24,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
export default (action, category, label, value) => {
|
||||
export default (action, category, label, value, nonInteraction = false) => {
|
||||
try {
|
||||
// gtag.js
|
||||
if (window.gtag) {
|
||||
return window.gtag('event', action, {
|
||||
event_category: category,
|
||||
event_label: label,
|
||||
value,
|
||||
});
|
||||
}
|
||||
// if (window.gtag) {
|
||||
// return window.gtag('event', action, {
|
||||
// event_category: category,
|
||||
// event_label: label,
|
||||
// value,
|
||||
// });
|
||||
// }
|
||||
|
||||
// analytics.js
|
||||
if (window.ga) {
|
||||
@@ -43,6 +43,7 @@ export default (action, category, label, value) => {
|
||||
eventAction: action,
|
||||
eventLabel: label,
|
||||
eventValue: value,
|
||||
nonInteraction,
|
||||
});
|
||||
}
|
||||
} catch (_) {
|
||||
|
Reference in New Issue
Block a user