Skip to main content

Hi there

I’ve installed the JavaScript SDK code snippet using “Insert Headers and Footers” in settings and fired amplitude.getInstance().logEvent('EVENT_NAME_HERE'); to activate. 

Amplitude has picked up the activate signal but not picking up traffic or users. What have I missed?

Many thanks
Manoj

Hi @skilleduplife ,

 

Thanks for writing into Community! Always great to see it being active!

 

So you have installed the JS SDK in the Header and the footer of the website on wordpress but it is not registering the events. I assume the API Key is correct and you are not using the Secret key?

 

Can you also follow the script and guide https://developers.amplitude.com/docs/javascript for the JS SDK as I believe the script there will give the newest version. Can you try that and see?

You said it was in the headers and footer section, can you make sure it is only in the header section before the <body> tag? I am not too familiar with WordPress but here seems to have an appropriate guide!

 

Can you make sure you have no VPNs or Ad-blockers? I would also make sure that WordPress isn’t blocking the SDK calls. I would try to see if the console brings up some errors or the network tab of your developer tools. 

 

I hope this helps! I am looking forward to your reply!

 

Kind Regards,
Denis


Hi Denis

I’m using the plugin you mentioned and it’s only added to the header. I used Javascript SDK and the code given under https://analytics.amplitude.com/SkilledUpLife/connections/project/334212/sources/setup/SDK_JS which includes the API key. 

Are you suggesting this script is old?

Noted at least one change "sha384-4rr7CTymHc64YjTTL6O3ktfsHYI1yJnQdmKv4zFoe+frjXb05MfzzuLLIAgJ/XHs” where as the code given to me with my keys for the same is “sha384-tzcaaCH5+KXD4sGaDozev6oElQhsVfbJvdi3//c2YvbY02LrNlbpGdt3Wq4rWonS”

In terms of the head, all scripts are appearing after <head> but before </head> and before <body>.

Inspection shows

<script type="text/javascript" integrity="sha384-tzcaaCH5+KXD4sGaDozev6oElQhsVfbJvdi3//c2YvbY02LrNlbpGdt3Wq4rWonS" crossorigin="anonymous" async="" src="https://cdn.amplitude.com/libs/amplitude-8.5.0-min.gz.js"></script>

Please advise.

Thanks
Manoj


The website is https://skilledup.life


Hi @skilleduplife ,


I think the script just doesn’t get the latest version. The one in the JS SDK specifies 

 

src="https://cdn.amplitude.com/libs/amplitude-8.11.0-min.gz.js"

While the data connections wizard displays 
src="https://cdn.amplitude.com/libs/amplitude-8.5.0-min.gz.js"

Can you make sure you are using 8.11.0 just to be sure? Thank you!

Noted at least one change "sha384-4rr7CTymHc64YjTTL6O3ktfsHYI1yJnQdmKv4zFoe+frjXb05MfzzuLLIAgJ/XHs” where as the code given to me with my keys for the same is “sha384-tzcaaCH5+KXD4sGaDozev6oElQhsVfbJvdi3//c2YvbY02LrNlbpGdt3Wq4rWonS”

This is just used for the different packages and will change between the versions.  just want to see if the latest version will alleviate any issues. And I assume no VPNs or Adblockers? Do you know if WordPress are blocking the SDK calls by any chance? I had a look at the website and I can see the Amplitude Script added to the home page so this is unusual. It is activated, you said, yes? 

Can you try to log an event with just amplitude.logEvent("Newest Signup"); and tell me if that works? Thank you!


Hi Denis

I replaced the whole code snippet and with only the API key changed. Nothing. 

This is becoming way too harder than anything I’ve used in the past.


Hi @skilleduplife ,

 

Did you try just amplitude.logEvent("EVENT_NAME_HERE"); instead of amplitude.getInstance().logEvent('EVENT_NAME_HERE');? I just want to be sure. 

 

In the meantime, while we try and troubleshoot the setup from our side, it might be a good idea to simultaneously contact the support team for WordPress just to ensure that it is set up correctly and/or they are not blocking Amplitude’s SDK calls. Are they able to verify that the code snippet is valid for their site? It should be but good to make sure it is not adding two <script> tags accidentally or something similar.

 

Have you tried to add a different script and does that work? Was it also a JS snippet?

Have you installed the chrome Amplitude Instrumentation Plugin? It can be helpful for debugging and checking if the SDK is connecting. 

Have you been able to run the JS SDK from a simple html file yourself? Are you able to send a simple event there trying both methods of logging? 
I would also try installing using npm locally and see if you can send an event then. 

Have you connected to a second wifi connection and tried then? 

How did you get confirmation that WordPress had activated the SDK may I ask?

 

Thanks!

 


Hi Denis

I’ll park this for the time being. WordPress is a CMS we use, which has millions of users. I doubt they would reply to me. 

We have many other analytics including Woopra, Intercom and so many, None of them presents with these issues.

Catch you another time. Thanks for trying to help.


All the best
Manoj

 


Hi @skilleduplife ,

 

I am more than happy to continue trying to troubleshoot this! I do think it might just be some setting somewhere that is not being enabled, especially if they activate the SDK but do not send the event. Are you sending it to the US server too? And not the EU Server URL? 

 

Kind Regards,
Denis


Hi @skilleduplife I’m Jeremie, your community manager. 😃 I wanted to circle back here to confirm that you were able to work things out here! Let me know!


I use Amplitude at my corporate job with our Node.js app, works fine… But I use WordPress to build marketing pages for my side-projects, so wanted to add Amplitude for better tracking. I spent the last 2 hours trying to get Amplitude integrated and it has been one of the more frustrating experiences I’ve had in a while. I eventually gave up and will be using a competitor… Extremely unintuitive and as the previous user made it very clear, with a CMS that is used my millions of people, I would expect a much smoother process.


Thanks for this feedback @sbarn1 We’ll make sure to share it with the team! 😊


Hi everyone! We have a new Amplitude plugin available in Wordpress. (More details here!)

 

The plugin is in beta, so excited to have more people try it and share feedback so we can make it better for you. 🙌

 

 


Reply