Skip to content

Commit

Permalink
Added an event trigger when opening an embedded pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
matiboux committed Nov 26, 2019
1 parent da79996 commit 5d4e69c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions _assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ $(document).ready(function() {

loadPdfEmbed($this.text(), url, $this);

gtag('event', 'open', {
event_category: 'Embedded PDF',
event_label: $this.text(),
transport_type: 'beacon'
});

history.pushState({embedUrl: url}, $this.text(), "?" + url.substr(url.lastIndexOf('/') + 1));
$('#embed').show();
});
Expand Down

0 comments on commit 5d4e69c

Please sign in to comment.