Social counter – data.replace error

Posted in: Newspaper
Post count: 12

Hi,
when adding facebook to social counter element in my homepage, I got this js error when clicking to “Get Access Token”
Uncaught TypeError: data.replace is not a function
at Object.eval (eval at <anonymous> (load-scripts.php:2), <anonymous>:86:57)
at i (load-scripts.php:2)
at Object.fireWith [as resolveWith] (load-scripts.php:2)
at y (load-scripts.php:4)
at XMLHttpRequest.c (load-scripts.php:4)

And “Please wait…” message always there

My website is news_DOT_adisupuglia_DOT_it (replace _DOT_ with .)
My FB page is https://www.facebook.com/ADISU-Puglia-279297038747259

Facebook Id inserted in social counter: ADISU-Puglia-279297038747259
Then inserted AppId and secretkey as per your tutorial.

But unable to Get Access Token

Can you please help ?
Thanks

Post count: 22421

Hello,

Please download the latest version of the theme from your envato account, then delete your current version of the social counter and install the one that comes with the update.

Thank you!

Post count: 12

Hi, sorry but still same problem.

Downloaded latest theme, deleted plugin and placed new social counter plugin

Got still same problem… 🙁

Post count: 12

Hi, might be this the problem

-facebook_access_token.val( data.replace( ‘access_token=’ , ” ) );
+facebook_access_token.val( data[“access_token”] );

I mean, the data object is not a string but has the “access_token” key ?

Post count: 22421

Hello,

You might not have installed the proper version of the social counter. The access toke works in the current version of the plugin. Please try to install it again from the main theme package you download from envato and very important: clear all your caching including the browser cache. Example for chrome: https://www.screencast.com/t/f9Q66lPx1fY

Thank you!

Post count: 12

Hi Bogdan,

just downloaded today and replaced the td-social-counter folder.
Deactivated, reactivated.

Still getting Please wait message when asking for the Access Token.

Thanks

Post count: 12

ALso cleaned browser cache as you suggested.

No caching plugin using.

Post count: 20688

Hi,

I do not know why this problem is happening, since it is working properly now for all other users. Maybe something else is causing this issue. I suggest you disable all your plugins except Visual composer and the social counter, switch to the main theme if you are using a child theme and clear any caching installed. Then check to see if you can configure the counter properly. You can use this guide for more information
https://forum.tagdiv.com/tagdiv-social-counter-tutorial/
If the issue is still present after you tried these methods, please send us an email at contact@tagdiv.com and provide admin login information, so we can take a look. Also paste a link to this topic so we can identify you.

Thanks

Post count: 12

Hi guys, I fixed by myself.
Here below the 2 problems

1) to get the access token td_social_counter.js needs this change
– facebook_access_token.val( data.replace( ‘access_token=’ , ” ) );
+ facebook_access_token.val( data[“access_token”] );

Then you can get the access token. Without this code change, noone should be getting the Access token.

2) in the facebook id, not the whole name has to be inserted, only the trailing numbers

Then it worked

I can’t explain how without code change in point #1, others may have it working, it should be failing everytime to all your customers

About point #2, I suggest to update your doc explaining facebook id (may be it is there and i missed it).

I placed a 5star to your theme, with friends we have several licenses from your great theme but I am not 100% happy of your support today.

I am sure next time it will go better

Thanks a lot.

Post count: 3

adisu, where can I change that code in step 1? I can’t find it in the code. It’s not working for me either. Thanks

Post count: 1

I got the same error. After reinstall of the newest version, another problem start:

Uncaught SyntaxError: Invalid or unexpected token
at eval (<anonymous>)
at load-scripts.php:2
at Function.globalEval (load-scripts.php:2)
at text script (load-scripts.php:4)
at Xb (load-scripts.php:4)
at y (load-scripts.php:4)
at c (load-scripts.php:4)
at Object.send (load-scripts.php:4)
at Function.ajax (load-scripts.php:4)
at Function.n._evalUrl (load-scripts.php:4)

the method of adisu also not working for me.

  • This reply was modified 9 years by ckho.
Post count: 12

@freefromdiana

it is in td_social_counter.js may be in the latest version I just installed

Post count: 1

Hi f_l_adisu, where find my facebook trailing numbers?

Post count: 12

Hi arciniegagerardo,
in my case
https://www.facebook.com/ADISU-Puglia-279297038747259
it was
279297038747259

Viewing 14 posts - 1 through 14 (of 14 total)
The forum ‘Newspaper’ is closed to new topics and replies.