Event tracking

August 23, 2022 07:41:46
Topics: 4
Messages: 11
Hi, is there any way we can add event tracking to the PDF button shortcode? We'd like to add something like;

onClick="gtag('event' , 'Click' , { 'event_category' : 'View brochure button', 'event_label' : 'Brochure title' });"

Thanks
August 23, 2022 07:55:03
E2Pdf
Topics: 7
Messages: 3617
Support
Hi,

Unfortunately, the E2Pdf link can't be currently modified with "onclick" event, however, we will review it to add its support.

Meanwhile, If you are using a static URL download name, you can just create your own link as follows:

<a href="[e2pdf-download id='1' output='url' esc_url_raw='true']" onClick="gtag('event' , 'Click' , { 'event_category' : 'View brochure button', 'event_label' : 'Brochure title' });">Download PDF</a>

* Keep attention to quotes

** esc_url_raw='true' in some cases must be removed depending on where the shortcode placed

P.S. If you need the URL to have a dynamic name - let us know please, we will try to speed up by adding "onclick" attribute.

We remain at your service.

We would really appreciate your feedback at WordPress.org!
August 23, 2022 08:16:55
Topics: 4
Messages: 11
That looks perfect, thank you!
Get News and Updates
Our monthly newsletter keeps you in the loop, so you'll always be up to date with the latest news and updates about E2Pdf.
* You can update your email subscription preferences here.
All trademarks, service marks, trade names, product names, and logos appearing on this website are the property of their respective owners. The use of trademarks such as Formidable Forms®, Forminator Forms®, Gravity Forms®, JetFormBuilder®, WordPress®, WooCommerce®, WPForms® and others is solely for identification purposes (nominative use) and does not imply any affiliation, sponsorship, or endorsement by the respective trademark holders.
© 2017 - 2026, https://e2pdf.com

We use cookies to collect and analyse information on site performance and usage, to provide social media features and to enhance and customise content and advertisements. By clicking "Accept Selected", you consent to use of selected cookies according to our Cookie Policy.