/
/
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 Retarget and Bring ‘em Back!
Mudd Advertising
Signs That Sell: Boosting Visibility
Mudd Advertising
Paid Search Advertising for Autos: Ignite Your Dealership’s Sales
All Categories
Tags
aia ads
automotive
chevy
ctv
digital marketing
direct mail
direct marketing
display
display ads
dynamic inventory display
email
email marketing
facebook
gbp
google analytics
google my business
google my business inventory
google shopping ads
internet marketing
local seo
MUDDid
mudd id
online marketing
pay per click
performance max
pmax
pop
ppc
radio
retargeting
search engine marketing
search engine optimization
sem
seo
social
social media
social media marketing
traditional marketing
traditional media
ux management
vehicle listing ads
video advertising
video production
vla
web ux