5.5K members online now
5.5K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply
Highlighted

Tracking a show/ hide spoiler phone number

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Have searched high and low in all wordpress forums but no solutions.

I want to track how many times my phone number gets viewed, so have added a show/ hide spoiler plugin that only shows the full number when clicked on.
Is there a way to add a conversion tracking code to that?

The text currently looks like this

[showhide]+27 83 694 4471[/showhide], and wondering if there is a way to add the tracking code in there somehow?

 

Any help would be much appreciated.

1 Expert replyverified_user

Re: Tracking a show/ hide spoiler phone number

Rising Star
# 2
Rising Star
Hi Peter,

If you need to track a user interaction (click) on your page, then Event tracking is your solution. Events can also be set as goals.

https://developers.google.com/analytics/devguides/collection/analyticsjs/events

Best,

Theo Bennett
Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

Re: Tracking a show/ hide spoiler phone number

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi Theo,

Thank you for your reply.
I'm happy to use the event tracking method, but my question still remains, the text currently looks like this
[showhide]+27 83 694 4471[/showhide], and wondering if there is a way to add the tracking code in there somehow?

Re: Tracking a show/ hide spoiler phone number

Rising Star
# 4
Rising Star
Hi Peter,

I can't tell you exactly how to code it because there a numerous ways to deploy that kind of functionality.

Basically you need to code your markup or deploy an event listener (GTM perhaps) or just build it into your JQuery of JavaScript that detects the user clicking/pressing on the element and then firing an event to Google Analytics.

Best,

Theo Bennett
Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

Re: Tracking a show/ hide spoiler phone number

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
try uding this:
_trackEvent(category, action, opt_label, opt_value, opt_noninteraction).
You can use any of the following optional parameters: opt_label, opt_value or opt_noninteraction. If you want to provide a value only for the second or 3rd optional parameter, you need to pass in undefined for the preceding optional parameter.

Re: Tracking a show/ hide spoiler phone number

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭
Hi sorry you misunderstood me, my question is how do I add the code to [showhide]+27 83 694 4471[/showhide] on a wordpress page

Re: Tracking a show/ hide spoiler phone number

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭
Wordpress makes use of plugins to achieve many of those functions. Go to "add plugins" and search for the most suitable of your choice.
Second method is to use the editor option to code it in... I hope you'll find this useful.

Re: Tracking a show/ hide spoiler phone number

Visitor ✭ ✭ ✭
# 8
Visitor ✭ ✭ ✭
I tell you, judging from the amount of people that are asking about a show/hide plugin that will also track how many times its been clicked, if someone where to come up with a plugin like this, they could make some good money out of it I think. I would certainly buy it.

Re: Tracking a show/ hide spoiler phone number

Rising Star
# 9
Rising Star
There are a lot of ways to add this functionality. This forum is for how to track the functionality. That said, here are a couple links that could be helpful:

http://www.w3schools.com/jquery/jquery_hide_show.asp

https://wordpress.org/search/show+hide

I recommend a different phone number for your site so that you can also easily see overall volume from the site as well.

Good luck!

Theo Bennett

Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

Re: Tracking a show/ hide spoiler phone number

Visitor ✭ ✭ ✭
# 10
Visitor ✭ ✭ ✭
Hi Theo,

I already have the show hide functionality on my website working perfectly by making use of a plugin, but my question is how do I track it?
Experts in the Topic
Theo Bennett