angulartics / angulartics-google-analytics

Google Analytics plugin for Angulartics
MIT License
133 stars 86 forks source link

Set called on unknown field: "$$html5". #105

Closed Benraay closed 7 years ago

Benraay commented 7 years ago

Hi I have noticed a weird thing on the trackings send by this implementation the send Event contains a lot of fields that are not used by google analytics why do you send all those with $$ in front ? ga("send", {$$html5: true, $$protocol: "http", $$host: "localhost", $$port: 50023, $$parse: [function], $$compose: [function], $$parseLinkUrl: [function], $$path: "/", $$search: {}, $$hash: "", $$url: "/", $$absUrl: "http://localhost:50023/", $$urlUpdatedByLocation: false, $$state: null, $$replace: false, hitType: "pageview", page: "/"})

it does not happen

DanWilkerson commented 7 years ago

I considered them harmless so I left them in; the change is the result of a fix to allow arbitrary property keys be set and passed in. They do junk up the debugger output, though, and are wasteful to include. I believe changing angular.extend({}, properties, ...) to angular.extend(angular.copy(properties), ...) will work just as well and cause those to be dropped, as .copy() ignores $ prefixed fields. I'll put in a patch.

Benraay commented 7 years ago

I tried to edit the new comment I have put but it does not work here is the whole message sorry :

I found this page on google analytics documentation : https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications

It says we should set the "page" and then call a "pageview" Event like this : ga('set', 'page', '/new-page.html'); ga('send', 'pageview');

and not putting the "page" parameter on the "pageview" Event because other calls like Events would be attached to the old page

Benjamin Raaymakers

CONFIDENTIALITY NOTICE:

The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and thendelete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited.

2017-05-13 20:02 GMT+02:00 Dan Wilkerson notifications@github.com:

Closed #105 https://github.com/angulartics/angulartics-google-analytics/issues/105.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/angulartics/angulartics-google-analytics/issues/105#event-1081060692, or mute the thread https://github.com/notifications/unsubscribe-auth/AAs1WWhmnj3lI8OXw4CPZ3Oz7oAUFSJTks5r5fBQgaJpZM4NaDUt .

DanWilkerson commented 7 years ago

Good news; the current codebase actually sets the page value on every hit, using the same URL as was set by the most recent trackPage. We're all covered on that front.

Benraay commented 7 years ago

I'm sorry I did'nt saw in the analytics debug I probably missed it

Benjamin Raaymakers

CONFIDENTIALITY NOTICE:

The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and thendelete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited.

2017-05-14 15:40 GMT+02:00 Dan Wilkerson notifications@github.com:

Good news; the current codebase actually sets the page value on every hit, using the same URL as was set by the most recent trackPage. We're all covered on that front.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/angulartics/angulartics-google-analytics/issues/105#issuecomment-301314244, or mute the thread https://github.com/notifications/unsubscribe-auth/AAs1WcZ39y0nSP4lQXAww2dxsN6rcr4bks5r5wRMgaJpZM4NaDUt .

DanWilkerson commented 7 years ago

No worries! Thanks for chiming in, I appreciate it.