Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

analytics.js firing events before clevetap can be initialized #740

Open
sinhaayush7 opened this issue Mar 27, 2023 · 3 comments
Open

analytics.js firing events before clevetap can be initialized #740

sinhaayush7 opened this issue Mar 27, 2023 · 3 comments

Comments

@sinhaayush7
Copy link
Contributor

Upon looking, we found that analytics.js is firing events (via analytics.track) before clevertap can be initialized.
t requests are for segment
a?type=page is the first request that is triggered on clevertap initialization
From the screenshot, we can see that the request goes properly to the segment, but since clevertap is not initialized at that point, the events are being lost in the process.

Could you help us with a workaround for this?
Screenshot 2023-03-27 at 11 54 59 AM

@joe-ayoub-segment
Copy link

Hi @sinhaayush7 ,
It's possible that this might be happening due to the way the customer has instrumented their website.
Would it be possible to ask the customer to raise a Support ticket by emailing [email protected], and include reproduction steps so that our Support Engineers can look deeper into the issue?

If it wasn't a customer who raised this issue you could still raise a Support ticket with the same information.

If you could include the following in the email it would be useful:

  1. link to website where Segment and Clevertap are configured
  2. reproduction steps explaining how to demonstrate the issue happening

Thanks you,
Joe

@KambleSonam
Copy link

@joe-ayoub-segment We have sent mail with the required links and steps to replicate the issue. Kindly look into it on priority.

@joe-ayoub-segment
Copy link

Copying my note from Slack here for posterity.

hi Darshan and Sonam , thanks for raising the ticket. It will be a Customer Support Engineer who will respond to the ticket. I don't have permission to look at customer's Segment Workspaces.
If they determine that the issue is not related to the way the customer instrumented their website then they might reach out to me.

I did have a quick look at the customer's website and could see that Segment events were triggering Clevertap events. I didn't notice that there was a mismatch in the numbers.
However it did seem like the Segment events and Clevertap events were being fired a second or 2 after the page loaded.
Perhaps the customer is not loading the Segment JS snippet correctly? For optimal results it's best to hard code the Segment JS snippet into the head tag of the website.

Another thing the customer could look into is to not trigger any Segment events until the Segment analytics.ready() function has fired.
Documentation for this can be found here.

The ready() function only fires after the Destination JS libraries have completed loading. in this case it would mean that Clevertap's library would be loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants