docbrown/app/assets/javascripts
Jeremy Friesen 21b81e3605
Restoring tracking of custom impressions without GA (#16142)
* Restoring tracking of custom impressions without GA

In #15967 I (@jeremyf) introduced the "don't do tracking if Google
Analytics ID is blank".  However, we still likely want to
trackCustomImpressions().

Further, I did some sleuthing and adding a couple of comments on whether
we should record page views for articles in draft status or any views by
the author.

* Ensuring we don't track views of author or unpublished

Prior to this commit, I was surprised to learn that we:

1) Tracked an author's view of their article.
2) Tracked views of an unpublished article.

This came up from a Forem creator asking if they could reset the view
counter.  Or trigger the reset on publication.

I think a general business logic policy of don't track views for the
author and don't track views for unpublished articles is a reasonable
default.

Were we to pursue the clear views on publication, we'd need to consider
something that went from unpublished -> published -> unpublished ->
published.  Without a more explicit state machine, triggering a
busineiss logic behavior seems a bit unexpected.

In other words, I wrote an article.  There are 20 views when I realize
that I need to unpublished it.  I make the changes in the unpublished
state, and re-publish.  I'd assume that those 20 views would still be
"recorded" and counted towards my article's view counts.

* Revert "Ensuring we don't track views of author or unpublished"

This reverts commit 321ecbed0ac4552e175d39bf17655a2fc93b265c.
2022-01-17 16:57:03 -05:00
..
initializers Restoring tracking of custom impressions without GA (#16142) 2022-01-17 16:57:03 -05:00
lib pullToRefresh adjustments - fixing scrolling hijacking (#15644) 2021-12-02 17:00:02 +01:00
utilities Patching ERB rendering of the data-info JSON (#16067) 2022-01-14 08:30:49 -05:00
.eslintrc.js Use a single listener for all follow buttons on a page (#14246) 2021-07-27 10:45:50 +01:00
base.js.erb Replace honeybadger-js with @honeybadger-io/js (#15770) 2021-12-15 08:39:08 -05:00
initializePage.js ✂️✂️✂️ Drop PWA (#15781) 2021-12-15 21:25:04 +01:00
jquery_s3_upload.js Ran prettier on *.js, *.jsx and *.md files. (#11586) 2020-11-23 20:45:50 -05:00