Skip to main content

Includes functions to diagnose duplicates in adwords elements

Project description

iy

Includes functions to diagnose duplicates in adwords elements

To install: pip install iy

Overview

The iy package provides a suite of tools designed to help diagnose and manage duplicate entries in AdWords campaigns. It includes functions for identifying duplicates based on various criteria such as keyword text transformations (stripping, lowercasing, ASCII conversion) and grouping by attributes like match type, ad group, or campaign. The package leverages pandas and numpy for data manipulation and analysis, ensuring efficient processing of large datasets.

Main Features

  • Keyword Duplicate Diagnosis: Identify duplicate keywords in your AdWords data, allowing for different levels of text normalization (e.g., stripping whitespace, converting to lowercase, ASCII encoding).
  • Statistical Analysis: Generate statistics about duplicates, including counts and ratios of duplicates, which can be broken down by type (e.g., exact, stripped, lowercase).
  • Grouping and Aggregation: Group data by specified keys and calculate duplication metrics for these groups.
  • Unicode Handling: Convert all keyword strings to Unicode to ensure consistency in text processing.

Usage Examples

Diagnosing Keyword Duplicates

To diagnose duplicates in a DataFrame containing AdWords data, you can use the kw_dup_diagnosis function. This function allows customization of grouping keys and duplication definitions.

import pandas as pd
from iy import kw_dup_diagnosis

# Sample DataFrame
data = {
    'keyword': ['example', 'example ', 'Example', 'sample', 'sample'],
    'match_type': ['Exact', 'Exact', 'Broad', 'Broad', 'Exact'],
    'ad_group': ['Group1', 'Group1', 'Group2', 'Group1', 'Group2'],
    'campaign': ['Campaign1', 'Campaign1', 'Campaign1', 'Campaign2', 'Campaign2']
}
df = pd.DataFrame(data)

# Diagnose duplicates
dup_info = kw_dup_diagnosis(df)
print(dup_info)

Generating Statistics for Duplicate Diagnosis

After diagnosing duplicates, you may want to generate general statistics to understand the extent of duplication:

from iy import general_stats_for_dup_diag

# Assuming `dup_info` is obtained from `kw_dup_diagnosis`
stats = general_stats_for_dup_diag(dup_info)
print(stats)

Advanced Duplicate Handling

For more complex scenarios, such as handling different types of duplicates across multiple dimensions (e.g., campaign and ad group), you can use the get_kw_duplicates_01 function:

from iy import get_kw_duplicates_01

# Get keyword duplicates with specific definitions
dup_details = get_kw_duplicates_01(df, dup_def='kw_lower', gr_keys=['match_type', 'ad_group', 'campaign'])
print(dup_details)

Function Documentation

  • kw_dup_diagnosis(df, grp_keys, grp_fun_dict, grp_id_name, grp_id_type, output_nondup_df): Analyzes a DataFrame for keyword duplicates based on specified grouping keys and duplication definitions. It returns a DataFrame with duplication information or optionally a tuple containing both the DataFrame with duplicates and the DataFrame without duplicates.

  • general_stats_for_dup_diag(diag_df, n_taps, n_broad_taps, dup_types): Computes and returns a dictionary of statistics about duplicates in the provided DataFrame. It can return the statistics along with the diagnostic DataFrame if the input DataFrame was not pre-diagnosed.

  • get_kw_duplicates_01(df, dup_def, gr_keys): An older function for obtaining keyword duplicates based on a specified definition of duplication (e.g., lowercased keywords). It supports merging results from different duplication criteria.

These functions are designed to be flexible and integrate easily into data processing pipelines for digital marketing analysis, especially for managing and optimizing Google AdWords campaigns.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iy-0.0.5.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iy-0.0.5-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file iy-0.0.5.tar.gz.

File metadata

  • Download URL: iy-0.0.5.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for iy-0.0.5.tar.gz
Algorithm Hash digest
SHA256 60c55456cb32278411b732abf50e20f201e3b5a14260da01a2a6f550666c6518
MD5 95ddb9a03c31243e8b44ffb212b6bc4c
BLAKE2b-256 927f7aaa72f5f0ae5e6cd5e89e63503f2d08ff36d2457f04b018ce96651f6161

See more details on using hashes here.

File details

Details for the file iy-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: iy-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for iy-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8a5474f7fb42a732e787f12401c63cffe1161202d82457adb02f7545701eef31
MD5 5ee5c7205ed0b0750b48ac632b6e82d5
BLAKE2b-256 cf06a38d13a9192a250c90ecb5b0afb1b8c578c92a938b7ab129d6a271340597

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page