/
/
How to Use Marchex JavaScript Rewrite in Google Tag Manager
Yes, you can use the Marchex JavaScript rewrite in Google Tag Manager. Here's how it's done.
Create a JavaScript Rewrite
In Marchex, create your JavaScript rewrite. Of course, be sure to specify the referring domain for use later in your _vsrefdom URL parameter. [gallery ids="7381,7379,7380"]Copy the JavaScript Rewrite Script
Scroll to the bottom of the JavaScript Rewrites page. Copy the code.Modify the JavaScript Rewrite Code
Change the src attribute from:src="//adtrack.voicestar.com/euinc/number-changer.js"to:
src="//adtrack.voicestar.com/euinc/number-changer-gtm.js"
Create Account in Tag Manager
[gallery ids="7384,7385"]Install the Tag Manager Script
Google recommends placing the code just after the opening <body> tag. However, Tag Manager and the contained Marchex tag will work regardless of where on the page the Tag Manager code is placed. In other words, ideally you'll have the the Tag Manager code placed in the recommended location. But if it has to be placed somewhere else on the page (e.g. between the <head></head> tags or at the bottom of the page), both Tag Manager and the Marchex rewrite will still work.Create the Tag and Trigger
- Name the tag "Marchex"
- Select "Custom HTML Tag"
- Paste your modified Marchex code into the "HTML" text area
- Select "Support document.write"
- Under "Fire On," click "More"
- Name the trigger "Page Load"
- Choose "Page View" as the Event
- Configure the trigger. Select "Window Loaded"
- Set "Fire On" to "All Page Views"
- Save the trigger and apply it to your tag
- Save your tag
Test Tag Manager and Marchex
Once the Tag Manager code has been installed, you will want to test it to make sure it's functioning properly.- Enter "Preview" mode
- Open a new tab in the same browser and visit the URL you wish to test (including the _vsrefdom parameter, e.g. www.meindlmotors.com/?_vsrefdom=test)
- If configured properly, the Marchex tag should fire on the "Page Load" event (and only on the "Page Load" event), and all corresponding textual phone numbers on the page should be rewritten.
Recent Posts
Mudd Advertising
Let’s leverage!
Mudd Advertising
Politics Schmolitics!
Mudd Advertising
Mudd has been promoted to Google Premier Partner
All Categories
Tags
anonymous website visitor identification
automotive
branding
cable
case study
chevrolet
chevy
data
digital marketing
direct marketing
display
dynamic inventory display
facebook
first party
google
google analytics
google premier partner
internet marketing
local seo
Matthew Moody
media
mobile search
mobile seo
MUDDid
online marketing
online video
organic
organic search
pay per click
political
ppc
promotion
retargeting
search engine marketing
search engine optimization
sem
seo
social advertising
social media
social media marketing
strategy
traditional marketing
traditional media
Volunteer Spotlight
youtube