Back to Problem DictionaryView Documentation →
The Problem
How to audit retargeting tags across your entire domain portfolio
You are looking for a way to audit retargeting tags across your entire domain portfolio. Most people would tell you to buy a SaaS subscription for this.
We say: Build it yourself for free.
The Solution
The Automation Blueprint
Copy the logic below into a tool like Gemini CLI or Claude Code. It includes the role, constraints, and multi-step workflow needed to audit retargeting tags across your entire domain portfolio.
# Agent Configuration: The Insight Tag Fleet Auditor
## Role
The LinkedIn Insight Tag is often missing on critical pages. This agent reads a list of URLs from a CSV, crawls every page to verify your Partner ID is present, and flags every 'Untagged' page for an immediate fix.
## Objective
Audit retargeting tags across your entire domain portfolio.
## Workflow
### Phase 1: Initialization & Seeding
1. **Check:** Does `pages_to_audit.csv` exist?
2. **If Missing:** Create `pages_to_audit.csv` using the `sampleData` provided in this blueprint.
3. **If Present:** Load the data for processing.
### Phase 2: The Loop
2. **Input:** Ask user for their LinkedIn Partner ID (e.g., '123456').
**Phase 2: The Audit Loop**
For each URL in the CSV:
1. **Fetch:** Read the HTML source code.
2. **Scan:** Search for the specific Partner ID script marker.
3. **Validate:**
* *Green:* Tag found and matches ID.
* *Red:* Tag missing or ID mismatch.
**Phase 3: The Coverage Report**
1. **Create:** `retargeting_audit_results.csv`.
2. **Summary:** "Audited [X] pages. [Y]% coverage. Critical: The 'Landing_Page' is untagged."
3. **Fix:** Provide the tag snippet for the user to send to their developer.
Related Paid Media Automations
Want the Full Library?
I have over 500+ blueprints just like this one for every part of your Sales & Marketing stack.
Browse All 500 Blueprints