Mobile app version of vmapp.org
Login or Join
Bethany197

: Variable contents depending on user agent and SEO I have a specific page that gives instructions to install/uninstall a software. Depending on the type of device visiting, the instructions are

@Bethany197

Posted in: #Dynamic #Seo

I have a specific page that gives instructions to install/uninstall a software.

Depending on the type of device visiting, the instructions are different, the rest of the page being the same. The amount of variable text approximately is the same as the constant text.

How does this affect SEO? Are any tags to state this situation?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Bethany197

2 Comments

Sorted by latest first Latest Oldest Best

 

@Angela700

It can actually give you a better position in seo, especially if you want to be listed in google, and your code detects a mobile device a display a properly-formatted page to that mobile device.

But the simple way to do this is in PHP. To start, create index.php containing these contents:

<!-- common header text/code goes here -->
<?php
$set=0;$user_agent=strtolower($_SERVER['HTTP_USER_AGENT']);
if (strpos($user_agent,"opera") !== false){include "opera.htm";$set=1;}
if (strpos($user_agent,"ie") !== false){include "ie.htm";$set=1;}
if ($set!=1){echo "<p>unknown user agent: ".$user_agent." detected</p>";}
?>
<!-- common footer text/code goes here -->


Then create opera.htm and ie.htm files and each of those files will contain instructions for opera browser and internet explorer browser (assuming ie is contained in the internet explorer user agent.)

for other browsers, add:

if (strpos($user_agent,"_____") !== false){include "_____.htm";$set=1;}


before:

if ($set!=1){echo "<p>unknown user agent: ".$user_agent." detected</p>";}


and replace the underline with a string in lowercase that is part of the new user agent (browser) and create a file with the same name with the htm extension and write instructions in the htm file.

If you have access to .htaccess I could make an answer for it too.

10% popularity Vote Up Vote Down


 

@Ann8826881

If the page content is only based on the user agent and is not accessible by different URLs then the search engines are only ever going to see one version of the page and that is the version that will be indexed.

But this is also a problem for users. Users don't always search for help (or whatever "instruction" you are providing) using the device that they need help on. It is also impossible to bookmark (or share) one set of instructions over the other; there is no canonical URL for the different instructions.

Intermediary caches / proxy servers can also be a problem. Caches are usually indexed on the URL - which is deemed to be unique. If you have the same URL serving different content, an intermediary cache (place of work, ISP, etc.) could end up serving the same cached content to different user agents. In order to try and get around this issue you would need to send the Vary: User-Agent HTTP response header.

The best approach IMO is to have separate URLs/pages for each set of instructions and simply link between them. (You can't auto-redirect as you will have the same user/search engine problems as above.) Change the page title and description to reflect the instructions shown.


Using JavaScript to show/hide.


JS is a possibility, depending on implementation. All content would be shown initially and JavaScript then hides the one that is not relevant. Don't have them both hidden to begin with (as you appear to suggest in the comment above) since you want search engines to see all the content.

However, you still need the ability for the user to view the other instructions, for the reasons mentioned above. And you should still provide the ability to bookmark the different instructions by changing the URL (perhaps vary the fragment identifier).

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme