Tracking CTA Single Page App


#1

Hi. I have been playing around with the CTA tracking and Im having a lot of trouble integrating them with my app.

As I understand the CTAs track clicks trough a redirection. I have a React app where links point to different parts of the app but don’t reload the window, so this method would literally kill the benefits of my single page app, since it will have to reload on every click.

Is there any way to send the “clicked” event without having to rely on a url redirection?

Thanks.


#2

@avillar You could use the timeline events API to log those types of activities. The embed code for the CTA was designed for marketing pages and not for a SPA.


#3

Thats perfect! Exactly what I was looking for.

Thank you very much @pmanca


#4

Im having a problem using the Timeline and Tracking API.

The Contacts API is working nicely, on my form submission I have set a POST call to createa a new contact, wich works flawlessly. But when trying to track an event I get nothing associated to that contact, I have even tried manually identifyng the contact I want, but still nothing shows in the timeline.

my _hsq array seems to be getting the pushed events fine, but they don’t seem to be executing.

Any clue of what might be happening?


#5

@avillar You might not be creating an association between the cookie and the contact. Try using the Forms API for the form submission instead of the contact API. This should tie the cookie to the contact so anything that gets pushed to your _hsq array will be logged correctly.