CMS Development

iamathlete
Contributeur | Partenaire solutions Platinum
Contributeur | Partenaire solutions Platinum

Displaying quantity of subscribers

Résolue

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 Votes
1 Solution acceptée
TRooInbound
Solution
Conseiller clé

Displaying quantity of subscribers

Résolue

 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

 

Voir la solution dans l'envoi d'origine

0 Votes
6 Réponses
TRooInbound
Conseiller clé

Displaying quantity of subscribers

Résolue

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 Votes
iamathlete
Contributeur | Partenaire solutions Platinum
Contributeur | Partenaire solutions Platinum

Displaying quantity of subscribers

Résolue

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 Votes
TRooInbound
Solution
Conseiller clé

Displaying quantity of subscribers

Résolue

 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 Votes
etafavoti
Participant | Partenaire solutions
Participant | Partenaire solutions

Displaying quantity of subscribers

Résolue

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 Votes
iamathlete
Contributeur | Partenaire solutions Platinum
Contributeur | Partenaire solutions Platinum

Displaying quantity of subscribers

Résolue

Thanks @TRooInbound!  

 

Hugely helpful.

 

Jimmy
Contributeur | Partenaire solutions Diamond
Contributeur | Partenaire solutions Diamond

Displaying quantity of subscribers

Résolue

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 !