5 min de leituraTutoriais

Prevent Duplicate Short Links When Importing a CSV

Prevent duplicate short links in CSV imports by checking slug collisions, deciding which campaign variants to keep, and reconciling partial import results.

DevRel · edge infra

Escreve sobre redirecionamentos, domínios personalizados e a API do Elido.

To prevent duplicate short links in a CSV import, check two things before uploading it. Look for repeated rows, then compare the hostname and requested path of each row against existing links. An identical destination is a separate signal. Two campaigns may point at the same page and still need distinct short addresses.

Keep the inventory open.

I'd do the comparison in a working copy with a stable row ID. That gives you something to reconcile after a partial upload, which is when a new batch of duplicates is easiest to create. The bulk import guide for Google Sheets covers how to prepare and submit the file itself.

Decide What Each Row Is Meant to CreateDecide What Each Row Is Meant to Create

Keep a stable row ID.

Write down the requested short hostname, slug, destination URL and campaign label. A slug on its own is ambiguous if your company uses different branded domains. The same path can be valid on one host and already assigned on another.

Put both addresses in the sheet. When a client wants separate results for a window poster and a printed brochure that open the very same landing page, ask the campaign owner which public URLs and tags should represent each placement before cleaning any rows.

Work from a copy. Keep the original. If a colleague comes back later to ask where a row went, the decision and the original line should still be easy to find in the project folder.

Classify Collisions Before Cleaning the FileClassify Collisions Before Cleaning the File

Look at the host and requested slug first. Then compare exact destination strings and inspect the rows together.

What you findExampleDecision before import
Same host, path and destinationTwo identical entries for go.example.com/saleKeep one import row and retain the duplicate's row ID in the notes
Same host and path, different destinationsTwo teams both ask for go.example.com/saleAsk which mapping owns the path and choose an explicit second slug if needed
Different short paths, same destinationPoster and newsletter both land on the sale pageKeep both when placement or reporting requires them
Existing public path in the exportgo.example.com/sale already worksDecide whether to retain or update the existing link before importing
Classify the Import Rows. Use the hostname and requested path to identify an address.

Follow the service's path rules when comparing. A spreadsheet might compare two strings as equal even though the redirect service treats them as different paths. Check how the tool handles case, reserved names and characters before applying a bulk lowercasing formula. The slug best practices guide covers naming decisions to make before a link goes public.

Find Matching Destinations Without Erasing Their MeaningFind Matching Destinations Without Erasing Their Meaning

A destination can carry an identifier that your CRM, ad platform or analytics tool needs. Keep the full value in the upload. Compare underlying pages in a separate review column so a cleaner-looking worksheet doesn't quietly strip measurement tags from the actual links.

For example, a poster may lead to example.com/sale with a campaign value for the shop window, while an email points to the same page with its newsletter tag. Grouping them can reveal that both depend on one landing page. It doesn't establish that one short link is safe to remove.

Check fragments too. If two links open different sections of the same documentation page, deleting one can create a frustrating support experience even though both point to the same host and path. If the URL is signed or has values you don't recognize, ask the system owner before changing it.

Export existing links from the workspace or collect the relevant paths from your provider. Match them against the working CSV. Flag requested addresses that already appear publicly and keep the prior mapping available for review.

Run a small import first. Pick a row that should succeed, one with an existing slug and one with an intentional duplicate destination. Read the resulting links and any error output. A setting that appends a suffix may be acceptable for a draft, but changes the address a printed flyer or partner email already carries.

Read the returned URLs. A successful import can still generate an unexpected path.

Reconcile the Import and Retry DeliberatelyReconcile the Import and Retry Deliberately

Don't retry the whole file yet.

Save the report and mark successes in the sheet. If the import stopped while the server was still processing rows, compare the destination workspace with the file before retrying and keep a note of any rows you can't verify. A timeout tells you the client stopped waiting. A write may still have happened.

Reconcile Before Retrying. Check the destination workspace after an interrupted import.

If you automate creation through an API, find out whether it supports an idempotency key. Stripe's API documentation gives a concrete example of reusing one key when retrying one operation. The behaviour is service-specific. Check its rules before relying on a key after the original request has changed or after the retention window has passed.

Use the original row ID to join a retry back to its source record. RFC 9110's explanation of idempotent methods is a useful distinction here. A second request should only be sent automatically when the client knows that doing so is appropriate for the operation.

For example, suppose rows 41 and 42 are marked created and row 43 has no response at all. If the latest export already shows row 43's short address and expected destination, treat it as complete and save that evidence. If it shows a different destination, send the collision back to the owner before trying again. If the address is missing, retry according to the provider's documented rules. Make this decision per row so you can still explain the final inventory when a batch includes both errors and successful writes.

Spot-Check What People Will OpenSpot-Check What People Will Open

Finish with a handful of actual short URLs. Include a collision that was resolved, a pair that shares a destination and a link used in a scheduled or printed campaign. Check the redirect and compare the final path and parameters with the approved worksheet.

File the outcome with the CSV. Record which rows were created, kept, updated or sent back for a decision. If you discover that a new link was already shared externally, confirm what you can safely do before deleting it. A duplicate in a worksheet is easier to repair than an address that has been sent to customers.

Perguntas frequentes

What counts as a duplicate short link in a CSV import?

Look for the same hostname and short path being requested more than once. Also check for exact repeated rows. The same destination might be intentional when several campaigns use different public addresses.

Can two short links have the same destination?

They can when the short addresses are distinct and the service permits it. Separate links can help distinguish campaigns or printed placements. Retain them when the reporting or published address depends on them.

Should I strip UTM parameters when finding duplicates?

Keep the complete destination in the import. You can group rows by the underlying page during review, but preserve meaningful campaign tags in the final mappings and verify any decision to merge rows.

How do I check whether a requested slug is already taken?

Compare your CSV's host and requested path against the current links on that hostname. Follow the shortening service's rules for case, allowed characters and reserved paths before classifying a collision.

What should I do if an import stops halfway?

Find out which rows succeeded through the response, import report or a new export. Preserve their published addresses and retry only the unresolved rows after you have classified conflicts and timeouts.

Does an idempotency key replace a duplicate check?

An idempotency key can make supported retries reuse one operation. It does not tell you whether two rows should represent one campaign, whether a slug is already owned, or which tags an editor meant to keep.

Experimente Elido

Cole uma URL, obtenha um link curto

Sem cadastro. O link vive 30 dias. Cadastre-se para mantê-lo para sempre.

É necessária uma conta grátis. O plano grátis inclui 25 links no total. Já tem uma conta? Entrar

Experimente o Elido

Encurtador de URL hospedado na UE: domínios personalizados, análises profundas e API aberta. Plano gratuito - sem cartão de crédito.

Tags
prevent duplicate short links
csv short link import
slug collision
bulk import reconciliation
deduplicate campaign urls
short link import retries

Continuar lendo