Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

track Pendo ad blocking #1122

Merged

Conversation

PanSpagetka
Copy link
Contributor

@PanSpagetka PanSpagetka commented Jan 14, 2021

Try to fetch pendo,if not successful log that pendo is blocked. By defaul fetchhas huge timeout, so I have made it 5 sec instead.

https://issues.redhat.com/browse/RHCLOUD-9700

@codecov-io
Copy link

codecov-io commented Jan 14, 2021

Codecov Report

Merging #1122 (1819de8) into master (8f6683d) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1122   +/-   ##
=======================================
  Coverage   53.01%   53.01%           
=======================================
  Files          65       65           
  Lines        1311     1311           
  Branches      258      258           
=======================================
  Hits          695      695           
  Misses        491      491           
  Partials      125      125           
Impacted Files Coverage Δ
src/js/analytics.js 64.51% <0.00%> (ø)

@PanSpagetka PanSpagetka requested review from ryelo and a team January 14, 2021 11:33
Copy link
Contributor

@Hyperkid123 Hyperkid123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of doing multiple requests for the same resource, we could also try using the onerror handler.

s.onerror = function(error){console.log(error, 'error')}

In this case you could add that callback to here

(v[w]);y=e.createElement(n);y.async=!0;y.src=`https://content.analytics.cloud.redhat.com/agent/static/${API_KEY}/pendo.js`

Targeting the "y" element.

y.onerror = function(error){log('Pendo blocked')}

@PanSpagetka
Copy link
Contributor Author

@Hyperkid123 Thanks! It seems to work and it is much nicer!

Copy link
Member

@ryelo ryelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of doing a regular log, can you either throw a console.error or log it to Sentry that way we can gather the metrics in sentry?

@Hyperkid123 Hyperkid123 merged commit 1a798fc into RedHatInsights:master Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants