Smart CTA doesn't work properly on external page

iToromoreno
Member

I'm trying to display a smart CTA on a external web page but it doesn't work correctly. I already add the tracking code and I'm using the tracking code API for identify the visitor.

 

I'm using a Developer Test Portal trial for this.

0 Upvotes
9 Replies 9
joceyng
HubSpot Product Team

Hi @iToromoreno, you mentioned that you've added the tracking code to your external pages. Is this referring to the HubSpot tracking code?

There are a few things I would advise to check on:

  1. Is the HubSpot tracking code firing correctly (see Troubleshoot the HubSpot tracking code)
  2. Are you viewing the external page as a tracked contact in your CRM who fits the smart criteria selected for the CTA?

If the HubSpot tracking code is installed and firing properly on your external page, HubSpot is already tracking page views and browsing activity. You should not need to use the tracking code API to identify the visitor separately.

 

That said, if you're using the Identify a Visitor function for a specific use case, it would be great if you can share some context here to help with troubleshooting 🙂

 

With reference to the documentation for the Tracking Code API, I would also like to clarify that the "Identify a Visitor" function has to be used in combination with a "Track Page View" function in order for the contact data to be passed to HubSpot. 

From Identify a visitor: "This function call stores the data in the tracker, but the data is not actually passed to HubSpot with this call.  The data will only be passed when tracking a pageview or an event (with either the trackPageView or trackEvent functions)."

 

Let me know if you have any questions, thanks!

 

Jocelyn

0 Upvotes
iToromoreno
Member

Hi  @joceyng  thanks for the response.

Yes I'm using the hubspot tracking code and I'm using the identify visitor API together with the tracking page API, even I can see that the user that I want to show a smart CTA (different than the default CTA) is registering activity on hubspot but the CTA image is always the same.

 

Here's my login page:

http://www.campaignsmanagement.xyz/cobis-bank/login

 

I'm loging in with this email from a hubspot contact that should watch a smart CTA:

alelola125@gmail.com (No need password).

 

I really appreciate if you can give me a fast explanation about how the hubspot tracking code identifies a visitor.

0 Upvotes
joceyng
HubSpot Product Team

Hi @iToromoreno, I've tested out your page and I noticed a few issues

  1. Contacts are not tracked from the login step, when their email address is provided. This means that the contact's first page view of the Internet Banking page is not tracked by HubSpot, and the smart CTA rules will not trigger
  2. From the contact timeline for alelola125@gmail.com, it looks like the page tracking only gets picked up after the event called "CTA Clicked" is triggered. Note how the timestamps of your page views only come after the CTA clicked event. 

 

I note that your login form has a POST action to the AJAX Forms API endpoint. If this is working properly, it should create/update a contact record when an email address is submitted with the login form. Based on my tests, it does not seem like the form submission is syncing form submissions to HubSpot properly. I recommend looking through the documentation (linked above) to verify that your form has been set up correctly.

 

If the login form is not syncing data to HubSpot, the tracking code will not be able to identify the website visitor and show the smart CTA that the person should be seeing. 


The best way to verify if the contact/visitor tracking is working, is to check if the contact record is updated with Page View data based on your most recent browsing activity. If the form submissiona and page views appear in HubSpot for the email address you've used in the login form, that means your website visitors are being tracked by HubSpot. 

Hope this helps to point you in the right direction! 🙂

 

Cheers, 

Jocelyn

iToromoreno
Member

Hi @joceyng, thanks again for your help, I fixed the issues that you told me before but the smart CTA still not working. I noticed that the smart CTA now is sending data to hubspot but the content is always the same, I tried to identify the visitor on my website using the tracking code API and the AJAX API but none of those worked for me.

 

I'm using Angular 8 for this demo so the CTA scripts won't be showed on the html code.

0 Upvotes
joceyng
HubSpot Product Team

hey @iToromoreno, sorry for the delayed response! I tried to access your site but it is no longer available at the URL you shared earlier. I have not worked with Angular 8 so I don't know how that will affect the CTA but basically the HubSpot tracking code firing on your web page must be able to identify the visitor in order for the smart CTA rules to take effect. 

0 Upvotes
iToromoreno
Member

Hi @joceyng  sorry for drawback, sometimes we have to turn out our environments to avoid innecesary expenses. I think I can fix my problem if I know where does the CTA script search for the visitor on my website?

 

Kind regards,

Iván T.

0 Upvotes
joceyng
HubSpot Product Team

hey @iToromoreno, no worries! Totally understand.
CTAs are 'generated' on your external page from the embed code when the HubSpot tracking code fires. There are 3 things you need for the smart rules to work properly on external pages (reference article)

 

  1. Visitor must be identified as a contact who meets the smart criteria
    eg. through a form submission synced to HubSpot, where the email address is provided and a hutk value (cookie) is collected in the form submission and passed to HubSpot
    eg. using the "Identify a Visitor" function in combination with a "Track Page View" function for the contact data (email address and cookie) to be passed to HubSpot.
  2. The CTA's embed code must not be stripped by the external CMS/page. As long as the default CTA appears, this should generally be okay
  3. If you're using multiple external subdomains, they must be tracked in your additional site domains and the Automatic cross-domain linking switch must be toggled on. This allows HubSpot to identify the same visitor across subdomains.

Do consider the order of events for #1 and #2 and the time it takes for a form submission to sync to HubSpot. The visitor must be identified before the page with the CTA is loaded. You may want to have the identification process happen on a separate page, before the visitor is directed to the page with the smart CTA.  

0 Upvotes
iToromoreno
Member

Hi again @joceyng I still can't get the cta to work, I checked all the steps that you numbered but the cta content is always the same. I don't know if it's possible to have a quick meeting with you or any other develepoer available for try to resolve this issue.

 

Thanks for your help, kind regards.

Iván T.

0 Upvotes
joceyng
HubSpot Product Team

Hey @iToromoreno , do you have access to our Support channels from a paid portal? Feel free to reach out to us over chat, email or phone (https://knowledge.hubspot.com/account/get-help-with-hubspot#hubspot-support) so we can help resolve this issue you're facing 🙂

Cheers, 
Jocelyn 

0 Upvotes