Find Jobs
Hire Freelancers

Send an event to Analytics when a FAQ entry is expanded

$10-30 AUD

Completed
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: 12838346

About the project

7 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
Awarded to:
User Avatar
Hello I am a Jquery and JavaScript expert I have 6 years of experience in this field. I have the knowledge of Google analytics and how to integrate it the project. so I am interested to work on this project. Thanks Kush
$40 AUD in 1 day
4.8 (21 reviews)
4.4
4.4
7 freelancers are bidding on average $34 AUD for this job
User Avatar
Hello I need this page URL, ftp or ssh access and 1 hour Thanks ..........................................
$50 AUD in 1 day
5.0 (20 reviews)
5.3
5.3
User Avatar
A proposal has not yet been provided
$30 AUD in 1 day
4.9 (27 reviews)
4.2
4.2
User Avatar
We are team of excellent developers. We have 2 year experience related to your project field. We can do your project and solve your all problems according to your requirements. We have read your description for projects and we understand what you want so we are confident that we can do it easily in mention time. We assure you that you will be completely satisfy with our work. And after delivering your project if you feel some issue in understanding the projects then we will teach you free until you understand. If you have any question then feel free to ask. We are here for you. Thank you Demon Developer Team
$30 AUD in 1 day
4.8 (25 reviews)
4.3
4.3

About the client

Flag of AUSTRALIA
Everton Park, Australia
5.0
40
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.