Solved

twitter count not working

Posted on 2013-06-20
2
237 Views
Last Modified: 2013-06-26
I got a script to put a twitter button on my site with a count.
yet, even though i tested it out and got people to click on it, it's staying at 0
the code looks like this
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://kars4kids.us/120huxG" data-text="I pledge not to txt and drive, u shud too!!! #TTYL #DontTextAndDrive" data-via="Kars4Kids">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</li>

Open in new window


What would I need to do to get a real count?
0
Comment
Question by:rivkamak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39264114
Has twitter crawled your page?
Looking at that page you have a count of 15
And the URL in the code is redirecting - the page must be accessible.
0
 
LVL 16

Accepted Solution

by:
hankknight earned 500 total points
ID: 39265883
Use this code instead:
<a href="https://twitter.com/share" class="twitter-share-button" data-via="http://kars4kids.us/120huxG" data-count="none" data-text="I pledge not to txt and drive, u shud too!!! #TTYL #DontTextAndDrive" data-via="Kars4Kids">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

Open in new window

If you want to customize it further, do so here:
https://twitter.com/about/resources/buttons#tweet

If you use that tool make sure to uncheck the "Show count" checkbox.
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question