Assisted_Conversions GoogleAnalytics

Tracking Referrals Across Sites You Own (Through Automated & Unique UTM Generation)


Let’s say you own two sites.

One is your blog (https://blog.placeit.net) and the other is an ecommerce site (https://placeit.net).

You use two different Google Analytics codes for each property and want to track which links from your blog created conversions but you don’t want to create a unique utm value for each link to indicate the source page.

We had the same issue here at Placeit so we made a little script for you to accomplish just that.

After pasting the script, you will see the URL of the source page as the utm-term automatically appended to all of the pages from the URL you specify.

In our case, the UTM source we use is “placeitblog” and if a blog post’s URL is “https://blog.placeit.net/print-custom-soccer-jerseys/” when users click on a link, the UTM term will be set to “print-custom-soccer-jerseys”, making the full URL:

https://placeit.net/c/design-templates/?f_devices=Logo&f_tags=Sports&h=3&utm_source=placeitblog&utm_term=print-custom-soccer-jerseys

  • If no campaign source is given, the code will only append the UTM term.
  • Otherwise, it will remove any existing UTM Source tag and replace it with whatever source was typed into the text box.
  • By typing a URL on the domain field you choose to append the UTM Campaign Source and Term only to links belonging to a specific domain, e.g https://yoursite.com
  • Leave the domain field blank will append the UTM code to all links on your site. This will include external links.

To use:

Just place the script in every page. If you’re using WordPress, you can put it in your header or footer.

And that’s it. Since using this method has made it super easy for us to track the performance of our blog posts as unique entities and not just as a whole, we thought it might also be useful for you to make your own script and add to your website or blog.

Feel free to use the UTM code generator and share it with peers and colleagues, we will be glad to know if you have any feedback for the team 🙂

UTM Generator

Copy the code generated and paste wherever you keep your site scripts. e.g. for wordpress the header.php file.

Append only to links with the following domain:
Campaign Source:
Append anchor/alt text as campaign content:

Output Code