Mobile app version of vmapp.org
Login or Join

Login to follow query

More posts by @Radia820

3 Comments

Sorted by latest first Latest Oldest Best

 

@Harper822

I found a way to add this GTM method directly into GA source and medium variables.

I applied the same GTM macros described above: URL Fragment and Lookup Table. I added a common start code ("cid") to each URL Fragment and that would go into table column 1. The column 2 would be the extended campaign description.
Lookup table looks like this:
1) cid-fb1 / facebook_video-ads
2) cid-fb2 / facebook_link-ads...

I duplicated the GA tag and adjusted the firing rules:
1) One only fires when the URL Fragment starts with "cid" and replaces campaign source tracking for the Lookup Table value.
2) The generic GA tag was kept the same but one only firing when the "cid" URL Fragment is not there.

So a link example.com#cid-fb1 would replace campaign tracking and one without "#cid-fb1" it would not.

10% popularity Vote Up Vote Down


 

@Gonzalez347

If you use Google Tag Manager then you can capture the value of the URL fragment and then match it with your Lookup Table macro. This is a much more efficient way of doing this.

1) Create a new Macro (Macro Type: URL -> Component Type: Fragment)

2) Create another Macro (Macro Type: Lookup Table)

a) enter all of your items such as fb, twitter, linkedin
b) use the macro from step one to match 'When {{macro1name}} equals'


3) Setup a new dimension in Google Analytics

4) Go to your Pageviews tag in GTM and under Custom Dimensions add your dimension index and the second micro.

10% popularity Vote Up Vote Down


 

@Gail5422790

You can set up Custom Dimensions in Google Analytics. First, I would recommend upgrading to Universal Analytics then do the following:


Sign in to Google Analytics.
Click Admin from the menu bar at the top of the page.
From the dropdown menus, select an account and a property to which
you want to add custom dimensions.
Under the Property column, click Custom Definitions, then click
Custom Dimensions.
Click New Custom Dimension.
Add a Name. This can be any string, but use something unique so it's not
confused with any other dimension or metric in your reports.
Select the Scope. Choose to track at the Hit, Session, User, or Product level. Read
more about scope and how custom dimensions are processed in our
Developer Guide.
Check the Active box to start collecting data and see the dimension
in your reports right away. To create the dimension but have it
remain inactive, uncheck the box.
Click Create.


Once you have your Custom Dimension created, you can use this function to send the hit to Google Analytics. This example uses PHP and you would need to create a Custom Dimension called ref.

<?php
if(isset($_GET['ref']))
{ ?>
<script>
ga('send', 'pageview', {'ref': '<?php echo $_GET["ref"]; ?>'});
</script>
<?php
}
?>

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme