/analytics/community?hl=en
This content is likely not relevant anymore. Try searching or browse recent questions.
-
4/22/19
Phone tracking code 1 Recommended Answer 5 Replies 78 Upvotes
1 Recommended Answer
$0 Recommended Answers
Last edited 4/22/19
Hello,

We would like the track the phone number 91- xxxxxxxxxx on our site.

I have placed the following code in the backend

<a href="tel:xxxxxxxxxx" onclick="ga('send', 'event', 'Click to call', 'Number clicked', 'xxxxxxxxxx;">91- xxxxxxxxxx</a>

Then created Goal as an event with the following settings

Goal Set up - Custom

Goal Description - Phone tracking

Goal details -

Category - Click to call

Action - Number clicked

Label - 91- xxxxxxxxxx


Is this the correct code ? or is there is anything missing ?  Please help

Thanks
All Replies (5)
5/8/19
Hi Peter
from the example given in your post
onclick="ga('send', 'event', 'Click to call', 'Number clicked', 'xxxxxxxxxx;"

There is a syntax error in the above code you posted, it is missing the last single quote character and the closing ). It should instead read as:
onclick="ga('send', 'event', 'Click to call', 'Number clicked', 'xxxxxxxx');"
Also is the site using Universal Analytics or the current gtag.js tracking code snippet?
If it is using gtag.js then the event tracking uses a different syntax.

For the goal.. make sure you enter goal category, action and label, exactly the same as it gets reported in GA
Also keep in mind, if testing, either use an incognito window or clear your cookies before each test. 
A goal will only succeed once as a goal conversion during the same session, so if you dont end the session before retesting, subsequent "conversions" wont work, which may lead you to think the goal setup is not working at all.
Also keep in mind.. goal data can take up to 72hrs to populate in the standard reports.
Last edited 5/8/19
marked this as an answer
Helpful?
-
5/9/19
Many Thanks Bronwyn V .  Here's some more information -


In  GA admin ( Tracking info > Tracking code ), the code starts with 
This is the Global Site Tag (gtag.js) tracking code for this property.

<!-- Global site tag (gtag.js) - Google Analytics -->

 But, in the backend, of website, i couldn't find this code. Here, the code goes like this -

<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

I wonder what;s going on. Traffic is being reported correctly in the reports.

From the above information, do i need to use the same tracking code provided by you ?
Last edited 5/9/19
marked this as an answer
Helpful?
-
5/10/19
Thanks Bronwyn V.

This time i have already recommended your answer to avoid mistake like the previous one...

I have now corrected the code as given by you. Here's the full code i have used on the website

<a href="tel:xxxxxxxxxxxx" onclick="ga('send', 'event', 'Phone Call Tracking', 'Click to Call', 'xxxxxxxxxxxx');">+91-xxxxxxxxxx</a>

The phone no. on the website starts with 91-


And set up Goal as an event with the following details

Category - Phone Call Tracking
Action - Click to Call
Label - xxxxxxxxxxxx

The phone no. starts with country code 91 ( It's an india based site, so country code is 91)

Not sure whether i should use 91 in the label or not. I think i have messed up here.
Last edited 5/12/19
marked this as an answer
Helpful?
4 days
I’m so confused where’s the code for snap
marked this as an answer
Helpful?
This question is locked and replying has been disabled.
Discard post? You will lose what you have written so far.
Write a reply
10 characters required
Failed to attach file, click here to try again.
Discard post?
You will lose what you have written so far.
Personal information found

We found the following personal information in your message:

This information will be visible to anyone who visits or subscribes to notifications for this post. Are you sure you want to continue?

A problem occurred. Please try again.
Create Reply
Edit Reply
Delete post?
This will remove the reply from the Answers section.
Notifications are off
Your notifications are currently off and you won't receive subscription updates. To turn them on, go to Notifications preferences on your Profile page.
Report abuse
Google takes abuse of its services very seriously. We're committed to dealing with such abuse according to the laws in your country of residence. When you submit a report, we'll investigate it and take the appropriate action. We'll get back to you only if we require additional details or have more information to share.

Go to the Legal Help page to request content changes for legal reasons.

Reported post for abuse
Unable to send report.
This reply is no longer available.
/analytics/threads
//accounts.google.com/ServiceLogin
You'll receive email notifications for new posts at
Unable to delete question.
Unable to update vote.
Unable to update subscription.
You have been unsubscribed
Deleted
Unable to delete reply.
Removed from Answers
Marked as Recommended Answer
Removed recommendation
Undo
Unable to update reply.
Unable to update vote.
Thank you. Your response was recorded.
Unable to undo vote.
Thank you. This reply will now display in the answers section.
Link copied
Locked
Unlocked
Unable to lock
Unable to unlock
Pinned
Unpinned
Unable to pin
Unable to unpin
Marked
Unmarked
Unable to mark
Reported as off topic
/analytics/profile/0?hl=en