SDKs overview

WeCanTrack provides Software Development Kits (SDKs) and libraries designed to facilitate programmatic interaction with its affiliate tracking and data aggregation platform. These resources enable developers to integrate WeCanTrack's functionalities into custom applications, automate data workflows, and extend the platform's capabilities beyond its standard user interface. The primary focus of these SDKs is to allow for the retrieval of aggregated affiliate marketing data, which includes performance metrics, conversion details, and linked network information. While WeCanTrack emphasizes no-code integrations for connecting to various affiliate networks, its API and accompanying SDKs are crucial for users requiring custom data processing, reporting, or synchronization with other business intelligence tools.

The platform's architecture supports data retrieval and limited configuration changes via its API. Developers can use the SDKs to programmatically access insights from connected affiliate networks, centralize performance data, and create tailored reporting solutions. Access to the WeCanTrack API, which the SDKs wrap, is typically available to customers on higher-tier plans, underscoring its utility for more advanced integration scenarios and custom development projects. For details on API plan availability, refer to the WeCanTrack pricing page.

Official SDKs by language

WeCanTrack offers official SDKs primarily for widely adopted programming languages, simplifying interaction with its API. These SDKs are maintained by WeCanTrack and provide a structured and often more efficient way to connect compared to direct API calls. They typically handle authentication, request formatting, and response parsing, abstracting away the low-level HTTP communication details. The official SDKs ensure compatibility with the latest API versions and provide a consistent developer experience.

The following table outlines the key official SDKs provided by WeCanTrack:

Language Package/Module Install Command Maturity
Python wecantrack-python-sdk pip install wecantrack-python-sdk Stable
JavaScript (Node.js/Browser) @wecantrack/javascript-sdk npm install @wecantrack/javascript-sdk Stable

Each official SDK is designed to reflect the WeCanTrack API's structure, offering methods corresponding to various API endpoints for operations such as fetching conversion data, retrieving affiliate network statistics, and managing integration settings. Developers can find comprehensive guides and API reference documentation for these SDKs on the WeCanTrack developer documentation site.

Installation

Installing WeCanTrack SDKs typically follows standard package management procedures for the respective programming languages. These commands retrieve the SDK from official package repositories, making it available for import and use within a development project.

Python SDK Installation

To install the Python SDK, developers can use pip, the Python package installer. This command fetches the package from the Python Package Index (PyPI).

pip install wecantrack-python-sdk

After installation, the SDK can be imported into Python scripts:

import wecantrack

client = wecantrack.Client(api_key="YOUR_API_KEY")

JavaScript SDK Installation

For JavaScript environments, typically Node.js projects or front-end applications that use a bundler, npm (Node Package Manager) or yarn can be used to install the SDK. The package is published on the npm registry.

npm install @wecantrack/javascript-sdk
# or
yarn add @wecantrack/javascript-sdk

Once installed, the SDK can be imported using ES modules or CommonJS syntax:

// ES Module syntax
import { WeCanTrackClient } from '@wecantrack/javascript-sdk';

const client = new WeCanTrackClient('YOUR_API_KEY');

// CommonJS syntax (for Node.js)
const { WeCanTrackClient } = require('@wecantrack/javascript-sdk');

const client = new WeCanTrackClient('YOUR_API_KEY');

Regardless of the language, an API key is required for authentication with the WeCanTrack API. This key should be kept secure and managed according to best practices, such as environment variables rather than hardcoding. Further information on API key management and security can be found in the WeCanTrack API Key Management guide.

Quickstart example

This quickstart example demonstrates how to retrieve a list of conversions using the Python SDK. The process involves initializing the client with an API key and then calling the appropriate method to fetch conversion data.

Before running this example, ensure you have installed the Python SDK using pip install wecantrack-python-sdk and replaced "YOUR_API_KEY" with your actual WeCanTrack API key.

import wecantrack
import os

# It is recommended to store your API key in an environment variable
API_KEY = os.environ.get("WECANTRACK_API_KEY") # Replace with "YOUR_API_KEY" if not using env vars

if not API_KEY:
    print("Error: WECANTRACK_API_KEY environment variable not set.")
    exit()

# Initialize the WeCanTrack client
try:
    client = wecantrack.Client(api_key=API_KEY)
    print("WeCanTrack client initialized successfully.")

    # Define parameters for fetching conversions
    # For real-world use, consider filtering by date, network, etc.
    # Refer to the WeCanTrack API documentation for available parameters
    # on the official WeCanTrack API for conversions.
    params = {
        "limit": 10,  # Fetch the latest 10 conversions
        "offset": 0
    }

    print(f"Attempting to fetch {params['limit']} conversions...")
    # Fetch conversions
    conversions_response = client.conversions.list(**params)

    # Process the response
    if conversions_response and conversions_response.get("data"):
        print(f"Successfully fetched {len(conversions_response['data'])} conversions.")
        for conversion in conversions_response["data"]:
            print(f"  Conversion ID: {conversion.get('id')}, Status: {conversion.get('status')}, Amount: {conversion.get('amount')}")
    elif conversions_response:
        print(f"No conversions found or data key missing: {conversions_response}")
    else:
        print("Failed to retrieve a valid response from the conversions API.")

except wecantrack.exceptions.WeCanTrackAPIError as e:
    print(f"WeCanTrack API Error: {e.status_code} - {e.message}")
except Exception as e:
    print(f"An unexpected error occurred: {e}")

This Python script provides a basic framework. For advanced usage, including error handling, pagination, and detailed filtering, developers should consult the WeCanTrack API Reference for Conversions.

Community libraries

Beyond the official SDKs, the WeCanTrack ecosystem benefits from community-contributed libraries and integrations. These resources are developed and maintained by third-party developers and often address specific use cases, integrate with other popular tools, or provide bindings for languages not officially supported by WeCanTrack. Community libraries can vary in maturity, documentation quality, and ongoing support, so developers should evaluate them based on their project's requirements and the library's active development status.

Examples of community contributions might include:

  • WordPress Plugins: Custom plugins designed to connect a WordPress site directly with WeCanTrack for easier tracking script deployment or conversion reporting within the WordPress admin panel. These often leverage the WeCanTrack's API to send data or retrieve statistics.
  • Custom Connectors: Scripts or modules built for integration platforms (e.g., Zapier custom integrations, Tray.io workflows) that allow WeCanTrack data to flow into or out of other business applications. For instance, a custom Tray.io integration flow could push WeCanTrack conversion data into a CRM.
  • Reporting Dashboards: Open-source projects that pull data from WeCanTrack via its API and visualize it in custom dashboards using tools like Grafana or specialized data visualization libraries.
  • Language Bindings: Unofficial SDKs or API clients for languages like Go, Ruby, or PHP, developed by community members to interact with the WeCanTrack API.

When considering a community library, it is advisable to check its associated documentation, GitHub repository for recent activity, and user reviews to assess its reliability and current maintenance status. While WeCanTrack does not officially endorse or support these libraries, they can offer valuable solutions for specific integration challenges. Developers are encouraged to share their contributions and seek community support through relevant developer forums or the official WeCanTrack community channels if available. For general best practices when working with third-party APIs and libraries, organizations like the Cloud Native Computing Foundation (CNCF) API security report offer guidance on secure integration patterns.