Coder Social home page Coder Social logo

web_sdk's Introduction

Summary

This is the guide to the Javascript SDK of Adjust™ for web sites or web apps. You can read more about Adjust™ at adjust.com.

Read this in other languages: English, 中文, 日本語, 한국어.

Table of contents

You can check how our SDK can be used in the web app by checking example app in this repository.

This SDK can be used to track installs, sessions and events. Simply add the Adjust Web SDK to your web app.

To install the SDK use npm:

npm install @adjustcom/adjust-web-sdk --save

In order to initialize the Adjust Web SDK you must call the Adjust.initSdk method as soon as possible:

Adjust.initSdk({
  appToken: 'YOUR_APP_TOKEN',
  environment: 'production'
});

Here is the full list of available parameters for the initSdk method:

Mandatory params

appToken string

Initialization method requires this parameter, so make sure to provide valid app token

environment string

This param is also mandatory. Available options are production or sandbox. Use sandbox in case you are testing the SDK locally with your web app

Optional params

attributionCallback function

This param accepts function, and it's a callback function for the attribution change. Two arguments are provided to the callback, first one is an internal event name (can be ignored), and the other one is the object which holds information about the changed attribution

Example:

Adjust.initSdk({
  // ... other params go here, including mandatory ones
  attributionCallback: function (e, attribution) {
    // e: internal event name, can be ignored
    // attribution: details about the changed attribution
  }
});

defaultTracker string

By default, users who are not attributed to any campaigns will be attributed to the Organic tracker of the app. If you want to overwrite this behaviour and attributed this type of traffic under a different tracker, you can use this method to set a different default tracker.

customUrl string

By default all requests go to adjust's endpoints. You are able to redirect all requests to your custom endpoint

eventDeduplicationListLimit number

By default this param is set to 10. It is possible to override this limit but make sure that it is a positive number and not too big. This will cache last n deduplication ids (defined by this param) and use them to deduplicate events with repeating ids

logLevel string

By default this param is set to error. Possible values are none, error, warning, info, verbose. We highly recommend that you use verbose when testing in order to see precise logs and to make sure integration is done properly. Here are more details about each log level:

  • verbose - will print detailed messages in case of certain actions
  • info - will print only basic info messages, warnings and errors
  • warning - will print only warning and error messages
  • error - will print only error message
  • none - won't print anything

logOutput string

It's possible to define html container where you want to see your logs. This is useful when testing on mobile devices and when you want to see logs directly on the screen (recommended only for testing)

namespace string

A custom namespace for SDK data storage. If there are multiple applications on the same domain to allow SDK distinguish storages and don't mix the data up each application should use it's own namespace.

Please note it's possible to set custom namespace for existing storage with default name, all data will be preserved and moved to the custom namespace. Once custom namespace is set it's not possible to rename it without data loss.

externalDeviceId string

Note If you want to use external device IDs, please contact your Adjust representative. They will talk you through the best approach for your use case.

An external device identifier is a custom value that you can assign to a device or user. They can help you to recognize users across sessions and platforms. They can also help you to deduplicate installs by user so that a user isn't counted as multiple new installs.

You can also use an external device ID as a custom identifier for a device. This can be useful if you use these identifiers elsewhere and want to keep continuity.

Check out our external device identifiers article for more information.

Note This setting requires Adjust SDK v5.1.0 or later.

Adjust.initSdk({
  // other initialisation options go here
  externalDeviceId: 'YOUR_EXTERNAL_DEVICE_ID', // optional
});

Important: You need to make sure this ID is unique to the user or device depending on your use-case. Using the same ID across different users or devices could lead to duplicated data. Talk to your Adjust representative for more information.

If you want to use the external device ID in your business analytics, you can pass it as a callback parameter. See the section on global callback parameters for more information.

You can use adjust to track events. Lets say you want to track every tap on a particular button. You would create a new event token in your dashboard, which has an associated event token - looking something like abc123. In order to track this event from your web app, you should do following:

Adjust.trackEvent({
  eventToken: 'YOUR_EVENT_TOKEN'
})

Make sure to track event only after you initialize the Adjust SDK. Here is the full list of available parameters for the trackEvent method:

Mandatory params

eventToken string

Track event method requires this parameter, make sure to provide valid event token

Optional params

revenue number

In case you want to attach revenue to an event (for example you would like to track some purchase that happened inside your web app) then you need to provide positive value for this param. It's also mandatory to provide currency param described in the next block

currency string

You need to provide this param if you want to track revenue event. Please use valid currency code like EUR, USD and so on

Example:

Adjust.trackEvent({
  // ... other params go here, including mandatory ones
  revenue: 110,
  currency: 'EUR'
})

When you set a currency token, adjust will automatically convert the incoming revenues into a reporting revenue of your choice. Read more about currency conversion here.

You can read more about revenue and event tracking in the event tracking guide.

callbackParams array

You can register a callback URL for your events in your dashboard. We will send a GET request to that URL whenever the event is tracked. You can add callback parameters to that event by adding callbackParams parameter to the map object passed to trackEvent method. We will then append these parameters to your callback URL.

For example, suppose you have registered the URL https://www.mydomain.com/callback then track an event like this:

Adjust.trackEvent({
  // ... other params go here, including mandatory ones
  callbackParams: [
    {key: 'key', value: 'value'}, 
    {key: 'foo', value: 'bar'}
  ]
})

In that case we would track the event and send a request to:

https://www.mydomain.com/callback?key=value&foo=bar

Please note that we don't store any of your custom parameters, but only append them to your callbacks, thus without a callback they will not be saved nor sent to you.

You can read more about using URL callbacks, including a full list of available values, in our callbacks guide.

partnerParams array

You can also add parameters to be transmitted to network partners, which have been activated in your Adjust dashboard. This works similarly to the callback parameters mentioned above, but can be added by adding partnerParams parameter to the map object passed to trackEvent method:

Adjust.trackEvent({
  // ... other params go here, including mandatory ones
  partnerParams: [
    {key: 'key', value: 'value'}, 
    {key: 'foo', value: 'bar'}
  ]
})

You can read more about special partners and these integrations in our guide to special partners.

deduplicationId string

It's possible to provide event deduplication id in order to avoid tracking duplicated events. Deduplication list limit is set in initialization configuration as described above

Tracking an event and redirect to an external page

Sometimes you want to redirect user to an external page and track this redirect as an event. For this case to avoid redirect to happen earlier than the event was actually tracked trackEvent method returns a Promise which is fulfilled after the SDK has sent the event and received a response from the backend and rejected when some internal error happen.

Important It might take pretty much time until this promise is settled so it's recommended to use a timeout.

Please note that due to internal requests queue the event wouldn't be lost even if it timed out or an error happened, the SDK will preserve the event to the next time it's loaded and try to send it again.

Example:

Promise
  .race([
    Adjust.trackEvent({
      eventToken: 'YOUR_EVENT_TOKEN',
      // ... other event parameters
    }),
    new Promise((resolve, reject) => {
      setTimeout(() => reject('Timed out'), 2000)
    })
  ])
  .catch(error => {
    // ... 
  })
  .then(() => {
    // ... perform redirect, for example 
    window.location.href = "https://www.example.org/"
  });

There are several methods available for global callback parameters like adding, removing and clearing them. Here is the list of each available method:

addGlobalCallbackParameters

It's possible to add global callback parameters, which will be appended automatically to each session and event request. Note that callback params passed directly to trackEvent method will override existing global callback params. This method accepts an array is the same format as for callbackParams parameter from trackEvent method

Example:

Adjust.addGlobalCallbackParameters([
  {key: 'key1', value: 'value1'},
  {key: 'key2', value: 'value2'}
]);

removeGlobalCallbackParameter

To remove particular callback parameter use this method by providing the key of a global callback param which needs to be removed

Example:

Adjust.removeGlobalCallbackParameter('key1');

clearGlobalCallbackParameters

In order to clear all global callback parameters simply call this method

Example:

Adjust.clearGlobalCallbackParameters();

It's possible to add, remove and clear global partner parameters in the similar way as for global callback parameters. Here is the list of each available method:

addGlobalPartnerParameters

It's possible to add global partner parameters, which will be appended automatically to each session and event request. Note that partner params passed directly to trackEvent method will override existing global partner params. This method accepts an array is the same format as for partnerParams parameter from trackEvent method

Example:

Adjust.addGlobalPartnerParameters([
  {key: 'key1', value: 'value1'},
  {key: 'key2', value: 'value2'}
]);

removeGlobalPartnerParameter

To remove particular partner parameter use this method by providing the key of a global partner param which needs to be removed

Example:

Adjust.removeGlobalPartnerParameter('key1');

clearGlobalPartnerParameters

In order to clear all global partner parameters simply call this method

Example:

Adjust.clearGlobalPartnerParameters();

By default when initiated Adjust SDK is always in online mode. But you can put it into offline mode if you want to pause all network requests such as tracking events and sessions (although initial session will ignore this mode and will be sent anyway). There are two methods available to swich on and off the offline mode:

switchToOfflineMode

This method will put the Adjust SDK into offline mode

Example:

Adjust.switchToOfflineMode();

switchBackToOnlineMode

This method will put the Adjust SDK back to online mode

Adjust.switchBackToOnlineMode();

It's possible to completely stop the SDK from running in certain situations. This means that SDK will stop tracking sessions and events and in general will stop working entirely. But it's possible to restart it after some time. Here are available methods for this functionality:

stop

This will stop running Adjust SDK

Example:

Adjust.stop();

restart

This will restart Adjust SDK

Example:

Adjust.restart();

There is functionality available to GDPR Forget particular user. This will notify our backend behind the scene and will stop Adjust SDK from running. There is one method available for this:

gdprForgetMe

This method will stop Adjust SDK from running and will notify adjust backend that user wants to be GDPR forgotten. Once this method is run it's not possible to restart Adjust SDK anymore.

Example:

Adjust.gdprForgetMe();

You can find more details here

There is functionality for the Marketing Opt-out, which is disabling third-party sharing ability. This will notify our backed in the same manner as it does for GDPR Forget me.

There is one method available for this:

disableThirdPartySharing

Example:

Adjust.disableThirdPartySharing();

To identify unique web users in Adjust, Web SDK generates an ID known as web_uuid whenever it tracks first session. The ID is created per subdomain and per browser. The identifier follows the Universally Unique Identifier (UUID) format.

To get web_uuid use the following method:

getWebUUID

Example:

const webUUID = Adjust.getWebUUID();

You can access your user's current attribution information by using the following method:

getAttribution

Example:

const attribution = Adjust.getAttribution();

Note Current attribution information is only available after our backend tracks the app install and triggers the attribution callback. It is not possible to access a user's attribution value before the SDK has been initialized and the attribution callback has been triggered.

You may want to set referrer to trigger sdk_click manually.

To set referrer use the following method:

setReferrer

Example:

Adjust.setReferrer("adjust_external_click_id%3DEXTERNAL_CLICK_ID");

Please note that referrer should be properly URL-encoded.

Important For proper attribution this method should be called as close as possible to SDK initialization.

The data residency feature allows you to choose the country in which Adjust stores your data. This is useful if you are operating in a country with strict privacy requirements. When you set up data residency, Adjust stores your data in a data center located in the region your have chosen.

To set your country of data residency, pass a dataResidency argument in your initSdk call.

Adjust.initSdk({
  "appToken": "YOUR_APP_TOKEN",
  "environment": "production",
  "logLevel": "verbose",
  "dataResidency": "EU"
})

The following values are accepted:

  • EU – sets the data residency region to the EU.
  • TR – sets the data residency region to Turkey.
  • US – sets the data residency region to the USA.

The Adjust SDK is licensed under the MIT License.

Copyright (c) 2020 Adjust GmbH, https://www.adjust.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

web_sdk's People

Contributors

alzbeta-knerova avatar lejohnduff avatar lemanchester avatar milica avatar sporiff avatar uerceg avatar yaramatkova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

web_sdk's Issues

Guidance Required for DMA Compliance with Adjust SDK

Hello,

I am currently integrating the Adjust SDK into my web application and aim to ensure compliance with the Digital Markets Act (DMA) as outlined in your article (https://help.adjust.com/fr/article/google-compliancy-with-the-dma). However, I'm encountering difficulties understanding how to correctly pass the new variables for DMA compliance:

eea=<boolean>
ad_personalization=<boolean>
npa=<boolean>
ad_user_data=<boolean>

Could you provide detailed guidance or examples on how to implement these variables within the SDK? Ensuring compliance is crucial for my application, and I would greatly appreciate any assistance or resources you can offer to help me understand and apply these requirements effectively.

Thank you very much for your support and the valuable resources you provide.

Adjust.getWebUUID is not a function

iam use the web sdk and i need to extract the uuid but when i call the getWebUUID function its return a null
iam using this code

### Adjust.initSdk({
        appToken: 'iam using my main appToken', // required
        environment: 'sandbox', 
        attributionCallback: function (e, attribution) { 
        },

    });
    const webUUID = Adjust.getWebUUID();

How to import sdk when install through NPM?

I install sdk through NPM:
npm install @adjustcom/adjust-web-sdk --save

In main.ts

// ???
import Adjust from '@adjustcom/adjust-web-sdk'

//initialize the Adjust Web SDK
Adjust.initSdk({
appToken: 'YOUR_APP_TOKEN',
environment: 'production'
});

how to import

npm install @adjustcom/adjust-web-sdk --save

how to import ?

thank you

Integrate into Electron application?

i have the Electron application。
now i need integrate adjust sdk into application。
the web_sdk can get real data on electron ? Like ios_sdk in ios and so on ?

Error "tracking disabled" after install Adjust SDK in VueJS

I'm doing config Adjust SDK (https://github.com/adjust/web_sdk) with VueJS.

After installing the library at npm install @adjustcom/adjust-web-sdk --save and import into the project as follow:

main.js:

import Adjust from '@adjustcom/adjust-web-sdk';

Adjust.initSdk({
  appToken: MY_TOKEN,
  environment: 'sanbox',
  logLevel: 'verbose'
});

Action in button:

Adjust.trackEvent({
  eventToken: 'MY_TOKEN'
})

After the installation is completed there was an error:

{error: "Attribution request failed (tracking disabled) (app_token:xxxxx) (platform:web)"}

Unclear how to use with cross-app tracking.

Hi, I would like to have clarified how to use this SDK in the context of a cross-app tracking (web-views/trusted web activities).
We need this SDK to be able to reference unique IOS or Android users to guarantee solid tracking of installs vs. events.

With this current implementation it's not clear how to instruct the sdk to map a given session/event to a given install (via device id).

Could you help me to find out how this can be achieved?

ATM we have our own small implementation of this SDK to achieve the above

web sdk does not work with SSR apps

Because of the references to window, the sdk doesn't work. Was this meant to work with SSR apps?

error - ReferenceError: window is not defined
    at eval (webpack-internal:///./pages/_app.jsx:54:1)
    at Module../pages/_app.jsx (/Users/Work/web/.next/server/pages/_app.js:139:1)

Document all necessary setup steps

According to the docs in this repo, the setup is just a simple Adjust.initSdk but every second issue mentions contacting the adjust support (I made the sentence longer because I found so many links).

So it seems that you should adapt your documention in this repo with all necessary steps or you put everything on the website and just link to it. (And very clearly mention that you need to contact support).
Currently this is a huge waist of our time as developers (because we try to debug non-issues) and yours, because you lovely adjust developers need to write the same sentence every 5 minutes.

If I get it correctly, we also need to setup web URLs, which should also be mentioned

Additional opinion: I think there is way too much reliance on contacting the support. There should be UIs for configuring more stuff. So far we had to every step of the way go through the support, taking days of our time away from us.

web sdk does not work with angular 10

I have been trying to integrate adjust sdk with our application, We are currently using angular 10. on given resources I am unable to find any resource that enable to integrate with typed interfaces.

I have come across https://github.com/adjust/web_sdk for web integration however upon including this sdk I am getting following errors.

Error: node_modules/@adjustcom/adjust-web-sdk/dist/adjust-latest.d.ts:159:1 - error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.

159 function initSdk({ logLevel, logOutput, ...options }: InitOptions): void

~~~~~~~~

Error: node_modules/@adjustcom/adjust-web-sdk/dist/adjust-latest.d.ts:327:16 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

327 const Adjust = {

               ~

328 initSdk,

~~~~~~~~~~

...

342 initSmartBanner,

~~~~~~~~~~~~~~~~~~

343 }

Tracking Link adjust_referrer query param missing

Hi,

When using tracking links, our tracking for the referrer is lost and events show up instead as organic. We would expect a query string to be appended to the redirect url - something like ?adjust_referrer=1234 - that the web_sdk will use on initialisation, but this seems to be missing.

For example - https://app.adjust.com/x1s01s2?redirect=https%3A%2F%2Fwww.traderepublic.com%2Fde-de%2F redirects to 'https://www.traderepublic.com/de-de/'.

I can't see any parameter when using curl either:

$ curl 'https://app.adjust.com/x1s01s2?redirect=https://www.traderepublic.com/de-de/' -I
HTTP/1.1 302 Found
content-type: text/html; charset=utf-8
location: https://www.traderepublic.com/de-de/
set-cookie: 94fe5d0296e873892a6511645b0c39c3=cX5TeqwSMgtdR; Path=/; Domain=adjust.com; Max-Age=2
set-cookie: 94fe5d0296e873892a6511645b0c39c3=cX5TeqwSMgtdR; Path=/; Domain=adjust.io; Max-Age=2
set-cookie: 94fe5d0296e873892a6511645b0c39c3=cX5TeqwSMgtdR; Path=/; Domain=adj.st; Max-Age=2
date: Thu, 25 Jun 2020 14:18:34 GMT
connection: close
X-Robots-Tag: noindex

Could you help us here?

Get web_uuid standard function

The react-native SDK has helper functions that make it straightforward to get the Adjust ID that has been set on a device. This is useful for server-to-server adjust events where the advertiser ID has to be passed from client to server before firing the event.

The web SDK should also have these helper functions, especially given that web_uuid can be stored differently depending on the browser/platform in question.

Is there a plan to support this in the near future?

Error al iniciar sesion.

Al momento de que se quiere iniciar sessión en adjust muestra este error

image

pero no es en todos los casos solo es en algunos especificos.
en la mayoria de los casos me responde correctamente.
image

web sdk not working

Hi,

I just want to raise an issue with your web SDK , and I have been followed the instruction you provided carefully.

Every time this code trigger inside a click event handler.

Adjust.trackEvent({
eventToken: 'YOUR_EVENT_TOKEN'
});

There something in the logs states "Running track event is delayed until Adjust SDK is up".

No idea why this shown up, I have been initialized the SDK before mounting the root component. And it seems that it initialize successfully the SDK.

Also, I want to attach this link as a reference https://github.com/juancarlosqr/adjust-issue , This is the same issue I have been dealing with. Btw, I'm using React.

Kindly let me know if I am missing something?

Thanks.

I'm using the web SDK package to integrate it in a NextJS project, but I'm getting "ReferenceError: self is not defined"

I'm facing this issue whenever I import your SDK as the following

import Adjust from "@adjustcom/adjust-web-sdk"

Whenever I use this Import way, The UI get blocked and and an error message with

"ReferenceError: self is not defined" appears."

Then, I imported the SDK as dynamic import as the following

const Adjust = import("@adjustcom/adjust-web-sdk");

    async initializeAdjust() {
        if (!this.adjust) {
            this.adjust = await Adjust;
            this.adjust.initSdk(this.config);
        }
    }

In this case the SDK works and I can see logs from the SDK on the console.log and I'm able to track events, but I'm still getting the same error on NextJS server console

Here is the full error

This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
ReferenceError: self is not defined
    at Object.<anonymous> (/Users/mohamedkamelalkhawam/projects/startappz/tv1001/web/node_modules/@adjustcom/adjust-web-sdk/dist/adjust-latest.js:10:4)
    at Module._compile (node:internal/modules/cjs/loader:1196:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
    at Module.load (node:internal/modules/cjs/loader:1074:32)
    at Function.Module._load (node:internal/modules/cjs/loader:909:12)
    at Module.require (node:internal/modules/cjs/loader:1098:19)
    at require (node:internal/modules/cjs/helpers:108:18)
    at Object.@adjustcom/adjust-web-sdk (/Users/mohamedkamelalkhawam/projects/startappz/tv1001/web/build/server/pages/_app.js:1244:18)
    at __webpack_require__ (/Users/mohamedkamelalkhawam/projects/startappz/tv1001/web/build/server/webpack-runtime.js:33:42)
    at Function.__webpack_require__.t (/Users/mohamedkamelalkhawam/projects/startappz/tv1001/web/build/server/webpack-runtime.js:139:38)
error - unhandledRejection: ReferenceError: self is not defined
    at Object.<anonymous> (/Users/mohamedkamelalkhawam/projects/startappz/tv1001/web/node_modules/@adjustcom/adjust-web-sdk/dist/adjust-latest.js:10:4)
    at Module._compile (node:internal/modules/cjs/loader:1196:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
    at Module.load (node:internal/modules/cjs/loader:1074:32)
    at Function.Module._load (node:internal/modules/cjs/loader:909:12)
    at Module.require (node:internal/modules/cjs/loader:1098:19)
    at require (node:internal/modules/cjs/helpers:108:18)
    at Object.@adjustcom/adjust-web-sdk (/Users/mohamedkamelalkhawam/projects/startappz/tv1001/web/build/server/pages/_app.js:1244:18)
    at __webpack_require__ (/Users/mohamedkamelalkhawam/projects/startappz/tv1001/web/build/server/webpack-runtime.js:33:42)
    at Function.__webpack_require__.t (/Users/mohamedkamelalkhawam/projects/startappz/tv1001/web/build/server/webpack-runtime.js:139:38)
NextJS Version: 13.1.2
React Version: 18.2.0
Node Version: 16.20.0

Event request failed (Bad event state: Ignoring duplicate event...)

In my project

It will excute the code when click some button

Adjust.trackEvent({ eventToken: 'myEventToken' }); window.location.href = 'http://otherDomain/xxx';

The Adjust.trackEvent request response is empty, I think because browser cancel the request.

now, I click the browser back button, It will call Adjust.trackEvent again, but the request get 400 http response code, the error message as follow:

{"timestamp":"2022-07-29T01:33:00.743Z+0000","message":"Event request failed (Bad event state: Ignoring duplicate event. Last event count: 17 this event count: 17 last event time: 2022-07-29T01:32:54 this event time: 2022-07-29T01:32:54)","error":"Event request failed (Bad event state: Ignoring duplicate event. Last event count: 17 this event count: 17 last event time: 2022-07-29T01:32:54 this event time: 2022-07-29T01:32:54)"}

trackEvent request is not sent before page redirect with React

I am trying to send a clicking event by AdjustSdk.trackEvent before doing external page redirect.
However the request is not sent even if I tried to make it asynchronus.
Is there any possible way to achieve this?

AdjustSdk.trackEvent('token', [
      { key: 'sample_key', value: 'sample_value' },
]);
// external page redirect
router.push()

An option to get attribution data instantly

Hello!

We have an option to get user attribution data for IOS and Android SDK.
But what about web SDK?
Can't see any info about that in docs, only about attribution callback.
Example for Android SDK below:

image

Event failed

it always throws Running track event is delayed until Adjust SDK is up when trying to hit event.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.