CMS Development

iamathlete
Colaborador | Partner nivel Platinum
Colaborador | Partner nivel Platinum

Displaying quantity of subscribers

resolver

Is there any way to display on a landing page the number of subscribers to a current list?  The goal of the landing page is to have people subscribe to the list and I'd like them to see that there are already xxx subscribers.

Anyway to automatically update that number from the actual total of list subscribers?

0 Me gusta
1 Soluciones aceptada
TRooInbound
Solución
Asesor destacado

Displaying quantity of subscribers

resolver

 Hi @iamathlete,

 

Yes there is other option for this, Instead of passing hapikey as per our previous answer you need to pass access_token,  this is link to generate access token to in your portal.

But it is bit longer one solution.

 

For more detail about authentication process in HubSpot please refer HubSpot Authentication Overview link.

 

And Yes @Jimmy, you are right thanks for your suggestion on this.

 

TRooInbound Team

For more help and solutions, please visit at www.trooinbound.com or email at hello@trooinbound.com

 

Ver la solución en mensaje original publicado

0 Me gusta
6 Respuestas 6
TRooInbound
Asesor destacado

Displaying quantity of subscribers

resolver

Hi @iamathlete,

 

Yes, you can display number of subscribers of particular list by AJAX, All you need to do is make AJAX call. Below is code provided you just need to replace your list id and your HubSpot API key, if you are not aware from where you get your hubspot api key, here is link to Get Hubspot API-key.

 

 

<script>
  $(document).ready( function(){
    var listId = <Your list id>;
    var apiKey = '<Your HubSpot API key>'

    $.ajax({
      type:"GET",
      url:"https://api.hubapi.com/contacts/v1/lists/" + listId +"?hapikey=" + apiKey,
      success:function(data){
        alert('Total size of the list is ' + data.metaData.size);
      }
    });
  });
</script>

Note: We just alert your list count value, If you are not familiar with this method please provide your page link in which you need to show list count, so we can assist you as per the link provided by you.

 

We hope it resolve your query.

Did my post help answer your query? Help the Community by marking it as a solution.

TRooInbound Team

For more help and solutions, please visit at www.trooinbound.com or email at hello@trooinbound.com

0 Me gusta
iamathlete
Colaborador | Partner nivel Platinum
Colaborador | Partner nivel Platinum

Displaying quantity of subscribers

resolver

Thanks TRooInbound for the suggestion.  I'd do it in a second but agree with Jimmy... I really don't want to post my unencrypted API key there.... Hmmmm... any other thoughts?

0 Me gusta
TRooInbound
Solución
Asesor destacado

Displaying quantity of subscribers

resolver

 Hi @iamathlete,

 

Yes there is other option for this, Instead of passing hapikey as per our previous answer you need to pass access_token,  this is link to generate access token to in your portal.

But it is bit longer one solution.

 

For more detail about authentication process in HubSpot please refer HubSpot Authentication Overview link.

 

And Yes @Jimmy, you are right thanks for your suggestion on this.

 

TRooInbound Team

For more help and solutions, please visit at www.trooinbound.com or email at hello@trooinbound.com

 

0 Me gusta
etafavoti
Participante | Partner
Participante | Partner

Displaying quantity of subscribers

resolver

Is this option with the access token possible on a landing page built in Hubspot? 

 

I really wish there was an easier solution to this.

0 Me gusta
iamathlete
Colaborador | Partner nivel Platinum
Colaborador | Partner nivel Platinum

Displaying quantity of subscribers

resolver

Thanks @TRooInbound!  

 

Hugely helpful.

 

Jimmy
Colaborador | Partner nivel Diamond
Colaborador | Partner nivel Diamond

Displaying quantity of subscribers

resolver

I won't recommand to use API key like that because everyboby will have access to it (if we inspect your code).

Remember that with your API key I can do what ever I want with what you have in your database !