Mobile app version of vmapp.org
Login or Join
Vandalay111

: I have multiple versions of the same landing page. How can I tell Google Analytics which is being viewed? I'm sending a link to a landing page to a number of different companies and need

@Vandalay111

Posted in: #GoogleAnalytics #Javascript #Php

I'm sending a link to a landing page to a number of different companies and need to be able to tell Google Analytics which company is viewing the page and when. I of course have my original link to the page tagged with UTM parameters accordingly, but I also need to build in a safety net in case someone passes the link around and removes that code.

The URL for the landing page looks like this:
www.website.com/landing_page/company_name/
The company_name part is not an actual directory on the server but part of a query string that I'm rewriting into the URI, so I don't believe I will be able to filter on that in Google Analytics. The company_name part will change depending on who I send it to.

So, I need to be able to add some sort of tag or flag in my GA code to tell GA which company is viewing the page.

How might I do that? What are my options?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Vandalay111

1 Comments

Sorted by latest first Latest Oldest Best

 

@Michele947

Something like this should do the trick:

_gaq.push(['_setCustomVar',
1, // This custom var is set to slot #1 . Required parameter.
'Company', // The name acts as a kind of category for the user activity. Required parameter.
$_GET['company_name'], // This value of the custom variable. Required parameter.
2 // Sets the scope to session-level. Optional parameter.
]);


That must be called before you call _trackPageview(). You can read more about custom variables here: developers.google.com/analytics/devguides/collection/gajs/gaTrackingCustomVariables

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme