PageSourceSearch

https://www.scribbr.co.uk/wp-content/themes/scribbr-2017/js/amplitude-page-events.js?ver=7.0.4

js scribbr.co.uk collected 2026-09-28 06:39:53 UTC 1,790 bytes, 46 lines download raw bytes

1//plagiarism prices block in viewport
2if ('IntersectionObserver' in window && (document.querySelector('.block--plagiarism_prices .price-box-wrapper') || document.querySelector('.block--plagiarism_2021_prices #prices'))) {
3  let priceBlock = '';
4  if(document.querySelector('.block--plagiarism_prices .price-box-wrapper')) {
5    priceBlock = document.querySelector('.block--plagiarism_prices .price-box-wrapper');
6  } else {
7    priceBlock = document.querySelector('.block--plagiarism_2021_prices #prices');
8  }
9  
10  let priceViewed = false;
11  let observer = new IntersectionObserver((entries, observer) => {
12    entries.forEach(entry => {
13      if (entry.intersectionRatio >= 0.10 && priceViewed == false) {
14        //timeout 2 seconds
15        setTimeout(function () {
16          priceViewed = true;
17          marketing.trackEvent('Price Viewed').sendToAmplitude();  // send to amplitude
18          // stop listening for this element
19          observer.unobserve(entry.target);
20        }, 2000);
21      }
22    });
23  }, { threshold: 1 });
24  observer.observe(priceBlock);
25}
26
27//header buttons clicked
28let headerButtons = document.querySelectorAll(`header.page-header a.btn`);
29headerButtons.forEach(function(elem, index){
30  elem.addEventListener('click', function(){
31    
32    var linkURL = elem.getAttribute('href').split('?')[0],
33          buttonText = elem.innerText;
34      let eventProperties = {
35        "destination_url": linkURL,
36        "location_url": ampliCurrentURL,
37        "button_text": buttonText
38      };
39    if(index == '0') {
40      marketing.trackEvent('Primary Button Clicked', eventProperties).sendToAmplitude(); // send to amplitude
41    } else {
42      marketing.trackEvent('Secondary Button Clicked', eventProperties).sendToAmplitude();  // send to amplitude
43    }
44    
45  })
46});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.