Skip to content

feat: accoil analytics destination - #3873

Merged
manish339k merged 3 commits into
rudderlabs:feat.accoil_analyticsfrom
sherlockscore:accoil-analytics-destination
Mar 11, 2025
Merged

manish339k merged 3 commits into
rudderlabs:feat.accoil_analyticsfrom
sherlockscore:accoil-analytics-destination

Conversation

@accoilmj

@accoilmj accoilmj commented Nov 12, 2024 •

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

Adds a new destination for 'Accoil Analytics'.

I'm not sure what new readability format mentioned in the checklist refers to; please advise.

Please explain the objectives of your changes below

Add destination for 'Accoil analytics' so that it shows up in the UI for selection as a destination on sources in Rudderstack and sends events to our system.

All events go to a "/segment" API and we support: track, page, screen, identify, group. We do not support batch natively but I was hoping that the handling here where it loops over them and returns a separate request will work. Please advise if not.

Documentation PR is here: rudderlabs/rudderstack-docs#1196
UI PR is here: rudderlabs/rudder-integrations-config#1807

Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

N/A

Any new dependencies introduced with this change?

N/A

Any new generic utility introduced or modified. Please explain the changes.

N/A

Any technical or performance related pointers to consider with the change?

N/A

@coderabbitai review


Developer checklist

  • My code follows the style guidelines of this project

  • No breaking changes are being introduced.

  • All related docs linked with the PR?

  • All changes manually tested?

  • Any documentation changes needed with this change?

  • Is the PR limited to 10 file changes?

  • Is the PR limited to one linear task?

  • Are relevant unit and component test-cases added in new readability format?

Reviewer checklist

  • Is the type of change in the PR title appropriate as per the changes?

  • Verified that there are no credentials or confidential data exposed with the changes.

@contributor-support

Copy link
Copy Markdown

Thank you @accoilmj for contributing this PR.
Please sign the Contributor License Agreement (CLA) before merging.

@accoilmj

Copy link
Copy Markdown
Contributor Author

Thank you @accoilmj for contributing this PR. Please sign the Contributor License Agreement (CLA) before merging.

I signed and submitted this form but it reported an error it was unable to update the PR status:

CLA signed. But we were unable to update the PR status.

We failed to remove 'Pending CLA' label automatically from your PRs.

Next steps:
1. Please make sure you submitted the correct information

    Your GitHub Username: accoilmj
    Your Email: [email protected]

2. Please ask PR reviewers to manually verify your CLA submission.< br />

Note: Only one CLA submission is required, irrespective of number of PRs you raised. 

@accoilmj

Copy link
Copy Markdown
Contributor Author

Hi @manish339k. Thanks for taking the time to review. This wasn't really ready for review yet, it was just what I threw together to try and get it working locally but it won't run for me so I uploaded this in the hopes maybe something stood out. I raised this in the Slack workspace: https://rudderstack.slack.com/archives/C026KTP7KPW/p1731403790462469

When I try to run this locally I just see this anytime I call it:

[
    {
        "metadata": {
            "destinationId": "destId",
            "workspaceId": "wspId"
        },
        "statusCode": 500,
        "error": "Cannot find module '../v1/destinations/accoil_analytics/transform'\nRequire stack:\n- <snip>/rudder-transformer/dist/src/services/misc.js\n- <snip>/rudder-transformer/dist/src/helpers/fetchHandlers.js\n- <snip>/rudder-transformer/dist/src/services/destination/nativeIntegration.js\n- <snip>/rudder-transformer/dist/src/helpers/serviceSelector.js\n- <snip>/rudder-transformer/dist/src/controllers/delivery.js\n- <snip>/rudder-transformer/dist/src/routes/delivery.js\n- <snip>/rudder-transformer/dist/src/routes/index.js\n- <snip>/rudder-transformer/dist/src/index.js",
        "statTags": {
            "errorCategory": "transformation"
        }
    }
]

Would any of the items you pointed out above potentially be the cause?

@accoilmj

Copy link
Copy Markdown
Contributor Author

I've pushed fixes for most of these items but it still doesn't seem to run locally

@manish339k

manish339k commented Nov 14, 2024 •

Copy link
Copy Markdown
Contributor

I've pushed fixes for most of these items but it still doesn't seem to run locally

@accoilmj Can you please check if you are sending "cdkV2Enabled": true in the payload?

"destination": {
            "DestinationDefinition": {
                "Config": {
                    "cdkV2Enabled": true
                }
            },
            "Config": {}
}

@accoilmj

Copy link
Copy Markdown
Contributor Author

Excellent @manish339k ! I wasn't setting that and now that I am it is working with a 200 and I can see my transformed JSON. Great. I can continue dev and testing on this now. Many thanks!

Apologies if I missed that in the setup instructions

@manish339k

Copy link
Copy Markdown
Contributor

@accoilmj, Could you please share the API documentation for Accoil analytics destination?

@accoilmj

Copy link
Copy Markdown
Contributor Author

@accoilmj, Could you please share the API documentation for Accoil analytics destination?

@manish339k we don't really have a published API for it. At its core it simply expects Segment (or Segment like) formatted payloads to the endpoint https://in.accoil.com/segment. There is doc on our Segment integration and the types of calls we accept here: https://segment.com/docs/connections/destinations/catalog/actions-accoil-analytics/

@manish339k

Copy link
Copy Markdown
Contributor

@accoilmj Could you please provide a test account so that we can validate and test the changes on our end?

@accoilmj

Copy link
Copy Markdown
Contributor Author

@accoilmj Could you please provide a test account so that we can validate and test the changes on our end?

Hi @manish339k you should be able to sign up yourself at https://app.accoil.com/ just click 'Sign up' and fill in your details. After signing up you'll have a trial account and you can go to Settings > Account > General and copy the API key.

@accoilmj

Copy link
Copy Markdown
Contributor Author

@manish339k were you able to get in and get the key needed for testing? Let me know if I can help.

@manish339k

Copy link
Copy Markdown
Contributor

@accoilmj I got the API key and am able to send the event. However, after sending the event, where can I verify the event delivery? Where should I check in the dashboard? I am seeing only one single page with API key after login.

I have one more question - I'm getting a 202 Accepted response even after sending the event without the authorization header. Is this expected behavior?

Screenshot 2024-11-28 at 11 16 27 AM

@accoilmj

Copy link
Copy Markdown
Contributor Author

@manish339k the system should recognise the data was received within 30 minutes and take you into the product and stop showing you that setup page. After that you should be able to create a profile and see events.

If it's taking longer than that then something is going wrong. I can look into where the events may be going.

As for whether it accepts it without the authorization header that is expected. Currently favours throughput so it accepts all calls and processes it later in batches so unfortunately you can't necessarily tell that it will wind up being rejected.

@accoilmj

Copy link
Copy Markdown
Contributor Author

@manish339k it looks like data has started showing up so you should be able to get into the app now and click "Profiles" in the top nav then create a new profile to see the data.

@manish339k

Copy link
Copy Markdown
Contributor

@accoilmj Thanks, I was missing the step of converting the API key to Base64 encoding. Now I am able to see the events in the dashboard. I will test, verify, and review the PR.

@accoilmj

Copy link
Copy Markdown
Contributor Author

Thanks @manish339k

@accoilmj

Copy link
Copy Markdown
Contributor Author

Hi @manish339k just checking in if there's anything further I need to work on here? Thanks.

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

This PR is considered to be stale. It has been open for 20 days with no further activity thus it is going to be closed in 7 days. To avoid such a case please consider removing the stale label manually or add a comment to the PR.

@manish339k manish339k removed the Stale label Jan 7, 2025
@manish339k

Copy link
Copy Markdown
Contributor

Add ACCOIL_ANALYTICS: true here

@manish339k manish339k changed the title Accoil analytics destination feat: accoil analytics destination Jan 7, 2025
@accoilmj

accoilmj commented Jan 8, 2025

Copy link
Copy Markdown
Contributor Author

@accoilmj

Copy link
Copy Markdown
Contributor Author

@accoilmj Please refactor the tests in the below format. processor - https://github.com/rudderlabs/rudder-transformer/blob/develop/test/integrations/destinations/active_campaign/processor/data.ts router - https://github.com/rudderlabs/rudder-transformer/blob/develop/test/integrations/destinations/active_campaign/network.ts

@manish339k I've refactored processor and router to more closely match active_campaign. They now use the same data types and imports and the tests pass.

I'm not sure what to do with network.ts though, can you please elaborate on that? You linked to it when mentioning refactoring router but I'm not sure how they relate. The contribution guide mentions processor and router but I don't see a mention to network.ts but I apologise if I've missed some documentation and if so please direct me to it.

Thanks 🙇

@manish339k

Copy link
Copy Markdown
Contributor

@accoilmj network.ts is not needed in this PR. It is only for mocking intermediate network calls.
PR looks good, I will have a final look.

manish339k
manish339k previously approved these changes Jan 22, 2025
@manish339k

Copy link
Copy Markdown
Contributor

@accoilmj please resolve the conflict.

@manish339k

Copy link
Copy Markdown
Contributor

cc: @utsabc / @ItsSudip for review.

koladilip
koladilip previously approved these changes Feb 7, 2025
@koladilip

Copy link
Copy Markdown
Contributor

can you resolve conflicts? @accoilmj

@accoilmj

accoilmj commented Feb 7, 2025

Copy link
Copy Markdown
Contributor Author

Taking a look now

@accoilmj
accoilmj dismissed stale reviews from koladilip and manish339k via d7b93de February 7, 2025 05:30
@accoilmj

accoilmj commented Feb 7, 2025

Copy link
Copy Markdown
Contributor Author

@manish339k @koladilip I've fixed the conflict and rebased it back up to date with develop

@manish339k
manish339k requested a review from koladilip February 12, 2025 10:46
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

This PR is considered to be stale. It has been open for 20 days with no further activity thus it is going to be closed in 7 days. To avoid such a case please consider removing the stale label manually or add a comment to the PR.

@manish339k
manish339k changed the base branch from develop to feat.accoil_analytics March 11, 2025 05:56
@manish339k

Copy link
Copy Markdown
Contributor

merging this to the feature branch.

@manish339k
manish339k merged commit 67c456b into rudderlabs:feat.accoil_analytics Mar 11, 2025
@manish339k

Copy link
Copy Markdown
Contributor

@accoilmj destination is live now.

@accoilmj

Copy link
Copy Markdown
Contributor Author

Thanks @manish339k and thanks for all your help reviewing and getting it over the line.

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

Successfully merging this pull request may close these issues.

4 participants