Posts tagged with reactjs

I am trying to work out, in nextjs (reacts) how would I insert a Google Adsense after say the 3 paragraph in the article?

basically we embed the content like this

 <Card.Body dangerouslySetInnerHTML={{__html: data.news.content }}>                    

And somehow I want to after it is loaded to check how many paragraph and insert the ad after say 3 paragraphs.

Google says this should be added to html on the "conversion page".

<!-- Event snippet for Website lead conversion page --> <script>gtag('event', 'conversion', {'send_to': 'AW-sdad/-dsafdsa'});</script> 

I have a ReactJS app, so I have no single html "conversion page".

Can I run it from javascript somehow?

createAccount = () => {     Axios.post(`/api/signup`, { user })       .then(async (resp) => {         await Axios.post("/api/login", { email: this.state.email, password: this.state.password });         this.props.history.push("/app");         // Run google ad convert here?       })       .catch((err) => {         console.log(err);       });   }; 

I would like to implement notifications through WhatsApp API into my app. I've done lots of research but I couldn't find anything official.

Officially WhatsApp API Bussiness exists, but it is a beta version and only for companies that send massive volume of messages (1 million+). There is also Twilio, it requires a business approval and I got denied because (again) my volume requirement isn't into the millions of messages per month.

Unofficial libraries exist that potentially could get the job done. I looked into it and the one that I was contemplating seemed to be unreliable. But is this really the only way?

Since the start of pandemic I've been receiving all sorts of ads with apps that offer WhatsApp notification for orders and customer services... how are they doing it? I know they are small businesses, so there must be a way.

My app was built using JavaScript/React, any information is appreciated.

I don't understand how to use this. The instructions say to call gtag_report_conversion when the action I want to track happens. I want to track signup to my site, so I know that the action was completed in my reducers actions file after I get a confirmation fo succesful signup.

How do I use this gtag_report_conversion? What is it? Is it a function? How do I call it? There's surprisingly almost no info in the instructions.

How does AdWords even know which action it is I was trying to track? What if I am trying to track a bunch of different actions, how does it know which is which if all it asks me is to call gtag_report_conversion

Would love some clarification as I currently have no idea what to do with this info. PLus these things can take hours to propegate so I can't just tru and chack the console to see if it worked or not.