Find Jobs
Hire Freelancers

Send an event to Analytics when a FAQ entry is expanded -- 2

$10-30 AUD

Cancelled
Posted about 7 years ago

$10-30 AUD

Paid on delivery
I am trying to work out which FAQs from our site are the most popular. I thought using GA would be the best way, so tried to use some of the existing JQuery that the user clicks to Open a question would be reusable: <div class="faq"> <div class="question" id="q<?= $i; ?>"> <?php the_sub_field('faq_question'); ?> <span class="ico icon-chevron-right"></span> </div> <div class="answer"> <?php the_sub_field('faq_answer'); ?> </div> </div> and <script> jQuery(document).ready(function(){ jQuery('.faq').click(function() { jQuery(this).toggleClass('open'); }); }); </script> I tried adding <!-- dodgy new code starts here --> var linkText = $(this).html(); alert(linkText); ga('send', 'event', 'FAQ', linkText); <!-- end dodgy new code --> into the script, but it includes the whole Question and Answer. When rendered on the page, the html displays as: <h3>General FAQ</h3> <div class="faq"> <div class="question" id="q1"> How many roads must a man walk down, before you can call him a man? <span class="ico icon-chevron-right"></span> </div> <div class="answer"> <p>The answer is "blowing in the wind".</p> </div> </div> I want to create an event that shows which FAQ entry has been clicked.
Project ID: 12839082

About the project

6 proposals
Remote project
Active 7 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
6 freelancers are bidding on average $21 AUD for this job
User Avatar
Hello sir/mam, I am good at : 1. WordPress web development 2. PSD to HTML 3. Responsive web development 4. Graphics Designing 5. Photoshop 6. PHP 7. html + CSS Styling 8. js & jQuery. you can check my work at "https://www.freelancer.com/u/webcast.html#/reviews" . I would like to work on your project. I Really Need this work. I'll not disappoint you. Thank you.
$35 AUD in 1 day
5.0 (74 reviews)
5.2
5.2
User Avatar
Hi, Thanks for the opportunity.I will give you 100% quality and perfect work As your need , we will Ready To start work,I offer a wide range of services, As per your requirement, i would like to tell you that I have a very strong experience in this field of design and development. Please spare a moment to discuss this project. Waiting for your message Thanks
$20 AUD in 1 day
4.6 (48 reviews)
5.3
5.3

About the client

Flag of AUSTRALIA
Everton Park, Australia
5.0
45
Payment method verified
Member since Aug 30, 2006

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.